日期:2014-05-17  浏览次数:20393 次

对路径“C:Inetpubwwwrootnutideimagespics6662.gif”的访问被拒绝
对路径“C:Inetpubwwwrootnutideimagespics6662.gif”的访问被拒绝
我后台是这么写的 为什么他会把我的\号都给弄没了啊?
                    string path = Server.MapPath("~");
                    string folder = "images\\LmImg\\";
                    string filename = FileUpload1.FileName;
                    FileUpload1.SaveAs(path + folder + filename);

------解决方案--------------------
string folder = System.Web.HttpContext.Current.Server.MapPath("/") + "/images/LmImg".Replace("/", "\\") + "\\";

你为什么要替换呢?

string folder = System.Web.HttpContext.Current.Server.MapPath("~/") + "/images/LmImg/";