该方法是什么意思,帮我翻译一下!谢谢!
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');
}