该方法是什么意思,帮我翻译一下!谢谢!

syzhangzz 2010-09-13 02:12:38
private static string[] GetFileList(string path, string WRMethods, string user, string pwd)
{
Trace.Write("GetFileList方法");

StringBuilder result = new StringBuilder();

FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(path));
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(user, pwd);
reqFTP.Method = WRMethods;
WebResponse response = reqFTP.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default);//中文文件名
string line = reader.ReadLine();

while (line != null)
{
result.Append(line);
result.Append("\n");

line = reader.ReadLine();
}

if (result.ToString().LastIndexOf('\n') >= 0)
{
result.Remove(result.ToString().LastIndexOf('\n'), 1);
}

reader.Close();
response.Close();
return result.ToString().Split('\n');
}
...全文
84 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2010-09-13
  • 打赏
  • 举报
回复
采用FTP的方法,得到FTP服务器上的文件列表
  • 打赏
  • 举报
回复
获得文件列表??????????
hztltgg 2010-09-13
  • 打赏
  • 举报
回复
得到ftp上某个文件夹的文件列表
chazikai24 2010-09-13
  • 打赏
  • 举报
回复
这个是获取FTP服务器某路径下文件列表的方法

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧