این کدشه، این کد تو یک حلقست، مدام داره اجرا میشه، نظر بدین
همینطور که میبینید، هر دو کد در یک قسمت، پس نمیشه با ترد اسلیپ کار کرد
try
{
System.IO.File.Copy(FileAdd, Path.ChangeExtension(FileAdd, "tmp"),true);
Attachment item = new Attachment(Path.ChangeExtension(FileAdd, "tmp"));
message.Attachments.Add(item);
try
{
item.Dispose();
}
load_file();
MessageBox.Show("Successfully");
catch (Exception)
{
MessageBox.Show("Faild");
item.Dispose();
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}