string str = Server.MapPath("~/manage/upload/"); System.IO.Directory.CreateDirectory(str + "/" + username + "/"); File1.PostedFile.SaveAs(str + "/" + username + "/" + username + newname); string strr = Path.GetFileName(str + "/" + username + "/" + username + newname);//有错误 string strfile = Server.MapPath(strr); super.Supervise_way = strfile;
取出的路径不对
老是出现错误
多了一个/,改为下面的代码:
string strr = Path.GetFileName(str + username + "/" + username + newname);
仔细,仔细,再仔细。。。。。。。。我也吸取教训了!