在运行垃圾收集器的程序大约10秒后,停止播放来自Wplayer的音乐。在垃圾收集器中使用了很多表单。
有什么办法让GC远离它? (网址是正确的并且有效。已经尝试完全停止Gc,但似乎无法正常工作。)
using System.Net;
using System.Net.Mail;
protected void end_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(yemail.Text, "Sender's Name");
msg.To.Add(new MailAddress(Email.Text));
msg.Subject = Subject.Text;
msg.Body = Message.Text;
msg.IsBodyHtml = true;
if(FileUpload1.HasFile)
{
msg.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.FileName));
}
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new NetworkCredential(yemail.Text, emailp.Text);
Label1.Visible = true;
try
{
smtp.Send(msg);
Label1.Text = "Email Send successfully";
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}