-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (26 loc) · 851 Bytes
/
Copy pathProgram.cs
File metadata and controls
30 lines (26 loc) · 851 Bytes
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
using System;
using System.Windows.Forms;
namespace ChatBotApp
{
internal static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Check if another instance is already running
bool createdNew;
using (var mutex = new System.Threading.Mutex(true, "RathiChatBot2", out createdNew))
{
if (!createdNew)
{
MessageBox.Show("Rathi ChatBot 2.0 is already running!", "Rathi ChatBot 2.0",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Application.Run(new MainForm());
}
}
}
}