string FilePath ,FileName;FilePath = "~uploadfile/zuoye/"+RadioButtonList1.SelectedValue.ToString() + "/"; //作业上传的物理路径
FileName = FileUpload1.FileName.ToString(); //上传文件的文件名
string targetpath = Server.MapPath(FilePath + FileName );
FileUpload1.PostedFile.SaveAs("targetpath");这样写为什么会出现根路径错误!!!
高手帮忙看下,哪里错了急!!!

解决方案 »

  1.   

    看看是否是“/”错误,因为在java和c#中下滑线是反的!
      

  2.   

    FileUpload1.PostedFile.SaveAs("targetpath");
    这里面的("targetpath")引号多余了,去掉就可以了
      

  3.   

    FilePath = "~/uploadfile/zuoye/"+RadioButtonList1.SelectedValue.ToString() + "/"; 
      

  4.   

    FFilePath = "~/uploadfile/zuoye/"+RadioButtonList1.SelectedValue.ToString() + "/"; //作业上传的物理路径
    FileName = FileUpload1.FileName.ToString(); //上传文件的文件名
    string targetpath = Server.MapPath(FilePath + FileName );
    FileUpload1.PostedFile.SaveAs(targetpath);