Dim OpenFileDialog As New OpenFileDialog
成都創(chuàng)新互聯(lián)公司是專(zhuān)業(yè)的響水網(wǎng)站建設(shè)公司,響水接單;提供成都做網(wǎng)站、成都網(wǎng)站制作,網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專(zhuān)業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行響水網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專(zhuān)業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專(zhuān)業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "文本文件(*.jpg)|*.jpg|所有文件(*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = OpenFileDialog.FileName
' TODO: 在此處添加打開(kāi)文件的代碼。
textbox1.Text = FileName
End If
第一個(gè)按鈕 上傳
Dim filelast As String = fileaddbefore.Text.Substring(fileaddbefore.Text.LastIndexOf("."), fileaddbefore.Text.Length - fileaddbefore.Text.LastIndexOf("."))
MessageBox.Show(filelast)
My.Computer.Network.UploadFile(textbox1.Text, "" 文件名.Text filelast, "登錄名1", "登錄密碼", True, 100)
第二個(gè)按鈕
Imports System
Imports System.IO.Ports
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'獲取計(jì)算機(jī)有效串口
Dim ports As String() = SerialPort.GetPortNames() '必須用命名空間,用SerialPort,獲取計(jì)算機(jī)的有效串口
Dim port As String
For Each port In ports
portnamebox.Items.Add(port) '向combobox中添加項(xiàng)
Next port
'初始化界面
My.Computer.Network.UploadFile
比如上傳到FTP
My.Computer.Network.UploadFile("d:\1.txt", "“, "FTP賬號(hào)", "FTP密碼", True, 100)
新手路過(guò)。