I have a file I attach to email in an ASP.NET application. The problem is that the process will not let go of the file. How do I close the file in the method so I can use it in my program again?
Attachment data = new Attachment(@"\\WIN-UWPWZ7Z3RKX\wwwroot\katipro\skus.txt");
m.Attachments.Add(data);
SmtpClient s = new SmtpClient("smtp.gmail.com", 587);
s.Send(m);
After I call the method it does not allow me to write to that file again without an error.