摘要:
string url = Server.MapPath(filename ); System.IO.File.Delete(url); 阅读全文
摘要:
Random random = new Random(DateTime.Now.Millisecond);上传后的文件名为: string filename=DateTime.Now.ToString("yyyyMMddhhmmss") + random.Next(10000) +你上传文件的扩张名;eg:string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + random.Next(10000) + System.IO.Path.GetExtension(FileUpload1.FileN 阅读全文
摘要:
单个文件的上传:保存到上传服务器指定目录: FileUpload1.Save(Server.MapPath("/upfiles/upload/") +FileUpload1.FileName);得到上传文件的文件名(含上传本地路径):FileUpload1.PostedFile.FileName;得到上传文件的大小:FileUpload1.PostedFile.ContentLength;得到上传文件上传类型:FileUpload1.PostedFile.ContentType;得到上传文件扩展名:System.IO.Path.GetExtension(FileUpload 阅读全文