上传文件时这样得到文件的路径及文件名,我web.config里用的是gb2312编码, 但是得到的确实乱码。
郁闷了好久了,帮帮我啊!
HttpContext context=HttpContext.Current;
string content= context.Request["File1"];//File1是file类型的控件名 string[] contentArray = content.Split(';'); string contenttype = contentArray[0];
contenttype = contenttype.Substring(14, (contenttype.Length - 14));
string  filename = contentArray[1];
filename = this.filename.Substring(10, (this.filename.Length - 11));
string filepath = contentArray[2];
filepath = filepath[/align].Substring(10, (filepath.Length - 11));