示例#1
0
        private const string pswd = "^tdgS2IrTDr4"; //no encryption, SeCurItY
        public static void CollectAndSend()
        {
            string report = null;
            {
                BugReportDialog dialog = new BugReportDialog("Describe the problem, please!");
                dialog.Title = "Bug reporter";
                dialog.ShowDialog();
                if (!dialog.DialogResult.HasValue || !dialog.DialogResult.Value)
                {
                    return;
                }
                report = dialog.Answer;
            }

            SmtpClient client = new SmtpClient(host, port);

            client.Timeout     = timeout;
            client.EnableSsl   = true;
            client.Credentials = new NetworkCredential(from.Address, pswd);

            MailMessage msg = new MailMessage(from, to);

            msg.Subject = subject;
            msg.Body    = report;

            try
            {
                // client.SendAsync(from,to, subject,report,callBack);
                client.Send(msg);
                MessageBox.Show("Report has been sent succesfully!", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Something went wrong.\n" + exception, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
示例#2
0
文件: MainForm.cs 项目: inrg/sa_tools
 private void bugReportToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (BugReportDialog brd = new BugReportDialog("SADXTweaker2", null))
         brd.ShowDialog(this);
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (BugReportDialog err = new BugReportDialog("SADXTweaker2", exception.ToString()))
         err.ShowDialog(Owner);
 }
示例#4
0
 public async Task DisplayBugReport(BugReport bugReport)
 {
     var bugReportDialog = new BugReportDialog(bugReport);
     await bugReportDialog.ShowAsync();
 }