我正在尝试使用vb代码上传文件。
我使用此凭据在https://www.infobyip.com/ftptest.php处查看了它正在运行: 主持人:mydomain.gr 港口:21 登录:mylogin Pasword:mypsw 目录:/ image / catalog
我的vb代码是:
Dim fname As String = "Images\Zar-" & Path.GetFileName(LocalDT(0)("ZarImageUrl").ToString)
Dim Client As New WebClient
Client.DownloadFile(LocalDT(0)("ZarImageUrl").ToString, Server.MapPath(fname))
Client.Dispose()
Upload("ftp://www.mydomain.gr", "mylogin", "mypsw", Server.MapPath(fname))
Using Client As New WebClient
Client.Credentials = New System.Net.NetworkCredential(UserName, Password)
Client.UploadFile(ftpServer + "/image/catalog/" + New FileInfo(filename).Name, "STOR", filename)
End Using
我收到此错误:无法连接到远程服务器 有什么想法吗?