![]() Request.Credentials = new NetworkCredential(username, password) įtpWebResponse response = request.GetResponse() as FtpWebResponse However, if you still face any issues while using it, please feel free to reply so that I can look into it.įtpWebRequest request = FtpWebRequest.Create( ) as FtpWebRequest It worked without giving any errors and I was able to download all files from my remote FTP folder. I have written and tested this code using Visual Studio 2005. MessageBox.Show(ex.Message, "Download Error") MessageBox.Show(wEx.Message, "Download Error") ![]() Int bytesRead = responseStream.Read(buffer, 0, Length) īytesRead = responseStream.Read(buffer, 0, Length) Stream responseStream = response.GetResponseStream() įileStream writeStream = new FileStream(localDestnDir "\" file, FileMode.Create) ReqFTP.Method = įtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse() ReqFTP = (FtpWebRequest)FtpWebRequest.Create( new Uri( "ftp://" ftpServerIP "/" remoteDir "/" file)) ![]() If (serverUri.Scheme != Uri.UriSchemeFtp) String uri = "ftp://" ftpServerIP "/" remoteDir "/" file Result.Remove(result.ToString().LastIndexOf( '\n'), 1) Reader = new StreamReader(response.GetResponseStream()) ReqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword) ReqFTP = (FtpWebRequest)FtpWebRequest.Create( new Uri( "ftp://" ftpServerIP "/")) StringBuilder result = new StringBuilder()
0 Comments
Leave a Reply. |