SMBServer v1.0.5

This commit is contained in:
Tal Aloni 2016-12-22 20:51:16 +02:00
parent b75820452d
commit bd1006cb81
400 changed files with 28062 additions and 0 deletions

45
SMBServer/Program.cs Normal file
View 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();
}
}
}