-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathProgram.cs
More file actions
60 lines (48 loc) · 1.8 KB
/
Program.cs
File metadata and controls
60 lines (48 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WebSurge
{
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
var limit = ServicePointManager.DefaultConnectionLimit;
if (ServicePointManager.DefaultConnectionLimit < 10)
ServicePointManager.DefaultConnectionLimit = 200;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var mainForm = new FiddlerCapture();
Application.ThreadException += Application_ThreadException;
try
{
Application.Run(mainForm);
}
catch (Exception ex)
{
Application_ThreadException(null, new ThreadExceptionEventArgs(ex));
}
}
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
var ex = e.Exception;
//App.Log(ex);
var msg = string.Format("Yikes! Something went wrong...\r\n\r\n{0}\r\n" +
"The error has been recorded and written to a log file and you can\r\n" +
"review the details or report the error via Help | Show Error Log\r\n\r\n" +
"Do you want to continue?",ex.Message);
DialogResult res = MessageBox.Show(msg," Error",
MessageBoxButtons.YesNo,MessageBoxIcon.Error);
if (res == DialogResult.No)
Application.Exit();
}
}
}