예제 #1
0
 protected override void OnStartup(StartupEventArgs e)
 {
     if (!GlobalMutex.TryGetMutex())
     {
         Environment.Exit(0);
     }
     else
     {
         base.OnStartup(e);
     }
 }
예제 #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            if (!GlobalMutex.TryGetMutex())
            {
                Environment.Exit(0);
            }
            else
            {
                base.OnStartup(e);
            }

            ServicePointManager.DefaultConnectionLimit = 25;
        }