当前位置: 代码迷 >> VB Dotnet >> ftp 550 出错
  详细解决方案

ftp 550 出错

热度:407   发布时间:2016-04-25 02:22:25.0
ftp 550 报错

不道为什么总报 550错 , 请问下面代码那里有问题 ? 

user = "abc"
pwd = "123"
url = "ftp://12.20.34.56/u2/gft/data/ligh0908.txt"
'''url = "ftp://abc:123@ 12.20.34.56/u2/gft/data/ligh0908.txt"
           
ftp.checkFileSize(url, user, pwd)

Public Function checkFileSize(ByVal serverurl As String, ByVal Str_UserName As String, ByVal Str_Password As String)

        Try


            Dim URI As String = serverurl
            Dim GetFileSize As Integer
            Dim ftp As System.Net.FtpWebRequest = CType(FtpWebRequest.Create(URI), FtpWebRequest)
            ftp.Credentials = New System.Net.NetworkCredential(Str_UserName, Str_Password)
            ftp.Method = WebRequestMethods.Ftp.GetFileSize
            Dim response As FtpWebResponse = ftp.GetResponse  '总是在代码报550错
            GetFileSize = response.ContentLength
            response.Close()
            Return GetFileSize

        Catch ex As Exception
            Throw ex
        End Try

    End Function


------解决方案--------------------
 My.Computer.Network.DownloadFile("Ftp://192.168.1.2/GL2008.exe", "C:\Temp_GL2008\GL2008.exe", "用户名", "密码")
------解决方案--------------------
110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server’s equivalent marker (note the spaces between markers and "="). 
重新启动标志回应。这种情况下,信息是精确的并且不用特别的处理;可以这样看:标记 yyyy = mmm 中 yyyy是 用户进程数据流标记,mmmm是服务器端相应的标记(注意在标记和等号间的空格) 120 Service ready in nnn minutes. 
服务在NNN时间内可用 125 Data connection already open; transfer starting. ----------------------------------- 
150 File status okay; about to open data connection. ----------------------------------- 
200 Command okay. ----------------------------------- 
202 Command not implemented, superfluous at this site. ----------------------------------- 
211 System status, or system help reply. ----------------------------------- 
212 Directory status. ----------------------------------- 
213 File status. ----------------------------------- 
214 Help message.On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user. 帮助信息。关于如何使用本服务器或特殊的非标准命令。此回复只对人有用。 215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document. 
NAME系统类型。 220 Service ready for new user. ----------------------------------- 
221 Service closing control connection. ----------------------------------- 
225 Data connection open; no transfer in progress. ----------------------------------- 
226 Closing data connection. Requested file action successful (for example, file transfer or file abort). ----------------------------------- 
227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). ----------------------------------- 
230 User logged in, proceed. Logged out if appropriate. ----------------------------------- 
250 Requested file action okay, completed. ----------------------------------- 
257 "PATHNAME" created. ----------------------------------- 
331 User name okay, need password. ----------------------------------- 
332 Need account for login. ----------------------------------- 
350 Requested file action pending further information ----------------------------------- 
421 Service not available, closing control connection.This may be a reply to any command if the service knows it must shut down. ----------------------------------- 
  相关解决方案