在公司不能上博客园,限制太多,基本上你能想到的博客是不能上了。邮箱也只能上内网的。纠结!
DateTime now = DateTime.Now;
newName = now.ToString("yyyyMMddHHmmss") + uploadFiles.PostedFile.ContentLength.ToString();
//上传路径 指当前上传页面的同一级的目录下面的wordTmp路径
string path = System.Web.HttpContext.Current.Server.MapPath("wordTmp/");
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
}
string aimPath = path + newName + extendName;
uploadFiles.PostedFile.SaveAs(aimPath);