refer:
 protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Click += (ss, ee) =>
            {
                string file = FileUpload1.FileName;
                FileUpload1.PostedFile.SaveAs(@"D:\123\123.txt");
            };
        }

解决方案 »

  1.   

    ---1. web.config设置
      <configSections>
        <section name="UploadFilePath" type="~/UploadFile"/>
      </configSections>
    ---2.  上传文件
    string strPath=System.Configuration.ConfigurationManager.AppSettings["UploadFilePath"]
    string uploadFilePath = HttpContext.Current.Server.MapPath(strPath);
    string savePhysicalFile = Path.Combine(uploadFilePath, "aaaa.txt");
    this.FileUpload1.SaveAs(savePhysicalFile); 
      

  2.   

    看不懂啊,我用的是完整路径。是web应用程序下面的一个路径,它是 "~"开头的