我正在上传文件。所以我想更改我的文件名。
string createfolder = "E:/tmp/jobres/" + uId;
System.IO.Directory.CreateDirectory(createfolder);
string newfilename = txtname.Text + "Resume" + fileExtension;
AsyncFileUpload1.SaveAs(Path.Combine(createfolder,newfilename ));
此时间文件采用不同的格式,而不是替换。
答案 0 :(得分:0)
string createfolder = "E:/tmp/jobres/" + uId;
System.IO.Directory.CreateDirectory(createfolder);
//AsyncFileUpload1.SaveAs(Path.Combine(createfolder,"Give Something Here whatever is changing at all time like time value"+AsyncFileUpload1.PostedFile.FileName));
AsyncFileUpload1.SaveAs(Path.Combine(createfolder,"DateTime.Now"+AsyncFileUpload1.PostedFile.FileName));