Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- bool existed;
- string guid = Marshal.GetTypeLibGuidForAssembly(Assembly.GetExecutingAssembly()).ToString();
- Mutex mutexObj = new Mutex(true, guid, out existed);
- if(existed)
- Application.Run(new MainForm());
- else
- {
- MessageBox.Show("Приложение уже запущенно");
- Application.Exit();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment