Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Files.Count > 0)
     {
         WebUploadFile _uploadFile = new WebUploadFile();
         _uploadFile.SetFileDirectory("/上传");
         UploadFileMessage _message = _uploadFile.Save(Request.Files["File1"]);
         Label1.Text = _message.HasError == false ? "上传成功" : "上传失败" + _message.Message;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Files.Count > 0)
     {
         WebUploadFile _uploadFile = new WebUploadFile();
         _uploadFile.SetFileDirectory("/上传");
         OperatedResult <UploadFileInfo> _uploadFileResult = _uploadFile.Save(Request.Files["File1"]);
         Label1.Text = _uploadFileResult.State == true?string.Format("上传成功,保存路径:『{0}』", _uploadFileResult.Data.FilePath) : "上传失败" + _uploadFileResult.Message;
     }
 }