Dim fn As String = e.Form.Controls("TextBox7").text
msgbox(fn)
If fn = "" Then
MessageBox.Show("请输入委保合同编号!")
Return
End If
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "Excel文件|*.xls|Word文件|*.doc|Access文件|*.mdb" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ftp1 As New FtpClient
ftp1.Host="0.0.0.0"
ftp1.Account = "F"
ftp1.Password = "F"
If ftp1.DirExists("\" & fn) = False Then
If ftp1.MakeDir("\" & fn) = False Then
MessageBox.Show("目录创建失败!")
Return
End If
End If
If ftp1.Upload(dlg.FileName,"\" & fn & "\" & FileSys.GetName(dlg.FileName)) = True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If