-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (30 loc) · 1.14 KB
/
Program.cs
File metadata and controls
35 lines (30 loc) · 1.14 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
using System;
using System.Diagnostics;
using System.Net;
using System.Threading;
using System.Windows.Forms;
namespace Vano.Tools.Azure
{
public static class Program
{
// Capture the synchronization context of the main thread
internal static SynchronizationContext SyncContext => SynchronizationContext.Current ?? new WindowsFormsSynchronizationContext();
[STAThread]
public static void Main(string[] args)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = e.ExceptionObject as Exception;
if (ex != null)
{
Trace.WriteLine(e.ToString());
}
}
}
}