本文整理汇总了C#中ApplicationInfo类的典型用法代码示例。如果您正苦于以下问题:C#ApplicationInfo类的具体用法?C#ApplicationInfo怎么用?C#ApplicationInfo使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:Main
staticvoidMain()
{
//newCrashLogTraceListener();
using(Mutexmutex=newMutex(false,MutexName))
{
if(mutex.WaitOne(1,true)==false)
{
MessageBox.Show("AnotherinstanceofConnectUO2.0Updaterisrunning.PleasewaitforthatinstancetoclosebeforerunningtheUpdateragain.","AlreadyRunning");
return;
}
for(Process[]processArray=Process.GetProcessesByName("ConnectUO.exe");processArray.Length>0;processArray=Process.GetProcessesByName("ConnectUO.exe"))
{
Thread.Sleep(50);
}
_applicationInfo=newApplicationInfo();
Directory.SetCurrentDirectory(_applicationInfo.BaseDirectory);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(newfrmUpdate());
if(_status==UpdateStatus.Success)
{
Process.Start(Path.Combine(_applicationInfo.BaseDirectory,"ConnectUO.exe"));
}
_applicationInfo.Process.Kill();
}
}
原文链接:
http://www.jxszl.com/biancheng/C/556556.html