Help with FTP

Last post 04-02-2008 9:09 by mish666uk. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-02-2008 5:52

    Help with FTP

     Hi. Can anyone see what is wrong with the following code:

                Dim ftpReqCreator As New FtpRequestCreator
                WebRequest.RegisterPrefix("ftp:", ftpReqCreator)
                Dim ftpUri As New Uri("ftp://" + LAN_FTP_Server + "/" + filename)
                Dim ftpReq As FtpWebRequest = WebRequest.Create(ftpUri)
                ftpReq.Credentials = New NetworkCredential(LAN_FTP_User, LAN_FTP_Password)
                Dim ftpResp As FtpWebResponse = ftpReq.GetResponse
                Dim ftpStr As Stream = ftpResp.GetResponseStream

    I get 'NullReferenceException' on the 'GetResponse' line. I know I can connect to the FTP server from the device because it works using internet explorer.

    Thanks in advance!

    Chris

    Filed under:
  • 04-02-2008 9:09 In reply to

    Re: Help with FTP

    I missed the line

    ftpReq.Method = WebRequestMethods.Ftp.DownloadFile

    But that doesn't solve the problem. 

Page 1 of 1 (2 items)