string memberpic = @"ftp://111.111.111.111/abc.jpg"; string ftpUser = "1111"; string ftpPassWord = "11111"; FtpWebRequest displayRequest = (FtpWebRequest)WebRequest.Create(memberpic); displayRequest.Method = WebRequestMethods.Ftp.DownloadFile; displayRequest.Credentials = new NetworkCredential(ftpUser, ftpPassWord); FtpWebResponse displayResponse = (FtpWebResponse)displayRequest.GetResponse(); Stream responcestream = displayResponse.GetResponseStream(); FileStream fs = new FileStream(memberpic, FileMode.Create); //it show error msg:The given path's format is not supported. byte[] buffer = new byte[102400]; int read = 0; do { read = responcestream.Read(buffer, 0, buffer.Length); fs.Write(buffer, 0, read); fs.Flush(); imgmemberpic.ImageUrl = memberpic; } while (!(read == 0)); fs.Flush(); fs.Close(); displayResponse.Close(); responcestream.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)