代码:
Dim j As WinForm.ComboBox = e.Form.Controls("ComboBox9")
Dim str As String = j.text
Dim s1 As String = str.SubString(4)
Dim s2 As String = str.SubString(0,3)
’假定 j .text 为:2013航空航天模型 则 s1为:航空航天模型 s2 为2013
Dim dlg As New OpenFileDialog
dlg.Filter= "文本文件|*.doc"
If dlg.ShowDialog = DialogResult.Ok Then
MessageBox.Show("你要打开的文件:" & dlg.FileName,"提示")
End If
Dim ftp1 As new ftpclient
ftp1.host="10.41.72.103"
ftp1.Account = "888"
ftp1.password = "888"
If ftp1.DirectoryExists("D:\武汉市中小学科技竞赛\s2\s1\秩序册") = False Then '如果不存在Data目录
ftp1.MakeDir("D:\武汉市中小学科技竞赛\s2\s1\秩序册") '则创建Data目录
End If
ftp1.upload(""& dlg.FileName &"","D:\武汉市中小学科技竞赛\s2\s1\秩序册\竞赛通知.doc", True)
‘ 这里能否增加代码 判断文件上传是否成功?
MessageBox.Show("文件已经成功上传")
错