ip为221.199.129.23 e盘下面有一个123.txt文件要下载下来 以此举例
回答:
最佳答案 假定221.199.129.23服务器上已经建立了FTP服务,用户名为test33密码为p@ssw0rd,且此用户的主目录为E:\。C:\>ftp
ftp>open 221.199.129.33
Microsoft FTP Service
Username: test33
Password: p@ssw0rd
ftp>bin
ftp>get 123.txt
ftp>bye刚才在网上查了这个方法,前面几步都没问题,但是到Password时就怎么也输不进去东西331 User name okay, need password
Password:
530 Not logged in.
Login failed.然后敲回车,就出现530问题了,这是怎么回事啊?
回答:
最佳答案 假定221.199.129.23服务器上已经建立了FTP服务,用户名为test33密码为p@ssw0rd,且此用户的主目录为E:\。C:\>ftp
ftp>open 221.199.129.33
Microsoft FTP Service
Username: test33
Password: p@ssw0rd
ftp>bin
ftp>get 123.txt
ftp>bye刚才在网上查了这个方法,前面几步都没问题,但是到Password时就怎么也输不进去东西331 User name okay, need password
Password:
530 Not logged in.
Login failed.然后敲回车,就出现530问题了,这是怎么回事啊?
http://blog.csdn.net/sheshou2/archive/2009/10/28/4737653.aspx
FTP
在浏览器栏中输入
ftp://test33:p@[email protected]
ftp://test33:p%[email protected]
那会是哪里的问题呢?
public static void FileDownload(string FileName) //fileName为虚拟路径
{
String FullFileName = System.Web.HttpContext.Current.Server.MapPath(FileName);
FileInfo DownloadFile = new FileInfo(FullFileName);
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ClearHeaders();
System.Web.HttpContext.Current.Response.Buffer = false;
System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream";
System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
System.Web.HttpContext.Current.Response.WriteFile(DownloadFile.FullName);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.End();
}
下载,直接调用方法
用 telnet 221.199.129.33 看看有没有反应?