public class CSMain
{
private CSMain() { }
static CSMain()
{
mUID = "2c81068a-7828-4769-8112-36754b67cdc5";
}
[STAThread]
static void Main()
{
try
{
bool firstInstance;
mSingleInstanceLock = new Mutex(true, mUID, out firstInstance);
if (firstInstance == true)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmLogin());
}
}
catch (Exception ex)
{
string err = ex.ToString();
}
}
private static string mUID;
private static Mutex mSingleInstanceLock;
}
No comments:
Post a Comment