请问上传中文标题乱码的问题
cs端:
String FileName = textBox2.Text;
try
{
if (FileName !="")
{ //文件上传,服务器端接收
myWebClient.UploadFile(ServerUrl, "POST", FileName);
MessageBox.Show(" 上传成功 ");
}
服务器端:ashx:
public class Uploader : IHttpHandler
{
public void ProcessRequest(HttpContext hc)
{
foreach (string fileKey in hc.Request.Files)
{
HttpPostedFile file = hc.Request.Files[fileKey];
file.SaveAs(Path.Combine(hc.Server.MapPath("./"), file.FileName));
}
}
public bool IsReusable
{
get { return true; }
}
}
症状:传上去,如果是中文文件名的话,显示乱码.
请问我如何转换下,正常显示。