接下来介绍ftp上传,代码如下:
Const Str_FtpServer As String = "ftp://ftp.lob.cn"
Private Str_Username As String = "lob" Private Str_Password As String = "xxxxxxxx"
Private Sub UploadImage(ByVal Str_Path As String, ByVal Str_Filename As String) Try Dim client As New WebClient client.Credentials = New NetworkCredential(Str_Username, Str_Password) client.UploadFile(Str_Path, Str_Filename) Catch ex As Exception MsgBox(ex.ToString) End Try End Sub
更多原创笔记来自lob.cn
调用方式:UploadImage(Str_FtpServer & "/logo.jpg", "d:\logo.jpg")
下一次的笔记介绍ftp创建目录 |