If e.Form.Controls("ListBox1").items(0) <> Nothing Then
Dim ftp1 As New FtpClient
ftp1.Host = "192.168.0.200"
ftp1.Account = "Admin"
ftp1.Password = "W3WE"
' ftp1.Port = 47758
Dim str As String
Dim str1 As String
MessageBox.Show(e.Form.Controls("ListBox1").Items(0))
str = e.Form.Controls("ListBox1").Items(0)
If ftp1.Upload(str, "/oldcloud/1.png") = True Then
Messagebox.show("上传完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
ftp1.Close
Else
Messagebox.show("上传失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
ftp1.Close
End If
Else
MessageBox.show("请选择文件!")
End If
前面用isnot null 也不对<>"" 也不行