mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-16 01:17:03 +02:00
SMBServer v1.0.5
This commit is contained in:
parent
b75820452d
commit
bd1006cb81
400 changed files with 28062 additions and 0 deletions
45
SMBServer/Program.cs
Normal file
45
SMBServer/Program.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SMBServer
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new ServerUI());
|
||||
}
|
||||
|
||||
public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
HandleUnhandledException(e.Exception);
|
||||
}
|
||||
|
||||
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
if (e.ExceptionObject != null)
|
||||
{
|
||||
Exception ex = (Exception)e.ExceptionObject;
|
||||
HandleUnhandledException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleUnhandledException(Exception ex)
|
||||
{
|
||||
string message = String.Format("Exception: {0}: {1} Source: {2} {3}", ex.GetType(), ex.Message, ex.Source, ex.StackTrace);
|
||||
MessageBox.Show(message, "Error");
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue