现有如下问题
FTP文件 :02/28/2013 10:57上午             10 新建 文本文档.txt
链接:ftp://****.net/%D0%C2%BD%A8%20%CE%C4%B1%BE%CE%C4%B5%B5.txt
当我下载文件时,文件名是"%D0%C2%BD%A8%20%CE%C4%B1%BE%CE%C4%B5%B5.txt"
文件名默认就是连接的文件名,既不方便管理也不直观;
现在我想要把特殊字符换成中文
请教各位有什么方法
代码如下:string URL = ftpServerIP;
string newURL = string.Empty;
//if (URL.Contains(@"\"))
//{
//   newURL= URL.Replace('\'', '/');
//}
int n = URL.LastIndexOf('/');
string URLAddress = URL.Substring(0, n);
string file = URL.Substring(n + 1, URL.Length - n - 1);
string Dir = filePath;
string Path = Dir + '\\' + file;FileStream outputStream = new FileStream(Path, FileMode.Create);
string[] arrfn = file.Split(new char[] { '.' }, StringSplitOptions.None);
                //Encoding ec = Encoding.Default;string fn = System.Web.HttpUtility.UrlDecode(arrfn[0], System.Text.Encoding.GetEncoding("GB2312"));//这里要转码,否则提示FTP无效reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(URLAddress + "/" + fn + "." + arrfn[1]));//文件名转码后重新拼接链接。否则提示FTP无效。
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
                
reqFTP.UseBinary = true;
reqFTP.KeepAlive = false;
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream());
Stream ftpStream = response.GetResponseStream();
long cl = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[bufferSize];
readCount = ftpStream.Read(buffer, 0, bufferSize);
//string ff = sr.ReadLine();
while (readCount > 0)
{
   outputStream.Write(buffer, 0, readCount);
   readCount = ftpStream.Read(buffer, 0, bufferSize);
}
reqFTP.Method = WebRequestMethods.Ftp.Rename;
reqFTP.RenameTo = Dir + fn + "." + arrfn[1];
ftpStream.Close();
outputStream.Close();
response.Close();
return 0;C#