ftp下载 包501错误
ftp下载 包501错误,说参数有错或无效上代码
public static bool DisplayFileFromServer(Uri serverUri,string pwd) { // The serverUri parameter should start with the ftp:// scheme. if (serverUri.Scheme != Uri.UriSchemeFtp) { return false; } WebClient request = new WebClient(); //连接 request.Credentials = new NetworkCredential("forumDB", pwd); try { byte[] newFileData = request.DownloadData(serverUri.ToString()); string fileString = System.Text.Encoding.UTF8.GetString(newFileData); Console.WriteLine(fileString); } catch (WebException e) { Console.WriteLine(e.ToString()); } return true; } static void Main(string[] args) { // Download(@"c:/","a.txt"); DisplayFileFromServer(new Uri("ftp://117.79.93.200//13_2_db120617.rar"),"ddddd");}