static void Main() { try { using (var game = new LinesGame(false)) { game.Run(); } } catch (Exception e) { string hash = GetHash(e.Message); MailMessage mail = new MailMessage("*****@*****.**", "*****@*****.**"); mail.Subject = "Error report."; mail.Body = "Hash: " + hash + "\n\n" + "Message: " + e.Message + "\n\n" + "StackTrace: " + e.StackTrace; SmtpClient client = new SmtpClient("smtp.gmail.com", 587); client.EnableSsl = true; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; // Google does't allow easy pass. Don't hack me please client.Credentials = new NetworkCredential("*****@*****.**", "57b4zdkn"); client.Send(mail); MessageBox.Show("Your hash is " + hash + ". We automatically sent error report to support.\n\n" + "If you want know more - contact me: [email protected]", "Error report"); } }
public LinesGame(bool isMobile) { instance = this; IsMobile = isMobile; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; }