DateTime.Now.Ticks极端情况下出现了重复,换guid试试

master
wanghaomei 2 years ago
parent 32174a90b3
commit a432bb51d5

@ -127,7 +127,7 @@ namespace MailSend.Web.Controllers
{ {
var bsArr = Convert.FromBase64String(att.AttachContent); var bsArr = Convert.FromBase64String(att.AttachContent);
var ext = Path.GetExtension(att.AttachName); var ext = Path.GetExtension(att.AttachName);
var fileTmpName = DateTime.Now.Ticks.ToString(); var fileTmpName = Guid.NewGuid().ToString();
var tempPath = Server.MapPath("~/Temp"); var tempPath = Server.MapPath("~/Temp");
if (!Directory.Exists(tempPath)) if (!Directory.Exists(tempPath))
{ {

Loading…
Cancel
Save