.Value是当前值
.Maximum为最大值
.Maximum为最大值
解决方案 »
- GridView头合并的问题
- 解释相爱这句代码的意思
- tables[0].Rows[0]["变量"]的问题,实在是不会,请高手指点一下,不胜感激!
- 我有一个别人提供的dll和pdb文件, 如何跟进去调试哇?
- 浣跨敤SmtpMail鍙戦偖浠跺繀椤绘彁渚涘彂浠朵汉鐨勯偖浠跺湴鍧€鍜屽瘑鐮侊紝鏈夋病鏈変竴绉嶆柟娉曞彲浠ヤ笉鎻愪緵鍙戜欢浜哄瘑鐮佸氨鍙
- 写入读取的问题,各位大哥帮忙看看。
- .net程序似乎更容易受病毒感染
- ClickOnce发布C#应用程序时怎样关联外部文件夹
- 一个让我头疼很久的数据库方面问题,高手请进!!!!!
- 一个关于remote技术的问题,请精通这方面的人帮忙!
- 如何在多个窗体中使用Ado.net
- listbox的参数传递问题,再线等
{
System.Threading.Mutex mutexMyapplication = new System.Threading.Mutex(false, "Your Application");
if(!mutexMyapplication .WaitOne(100, false))
{
MessageBox.Show("本程序已经在运行");
return;
}
Application.Run(new Form1());
}
public static void Main()
{
//Get the running instance.
Process instance = RunningInstance();
if (instance == null)
{
//There isn't another instance, show our form.
Application.Run (new Form());
}
else
{
//There is another instance of this process.
HandleRunningInstance(instance);
}
主要代码:public static Process RunningInstance()
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName (current.ProcessName);
//查找相同名称的进程
foreach (Process process in processes)
{
//忽略当前进程
if (process.Id != current.Id)
{
//确认相同进程的程序运行位置是否一样.
if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == current.MainModule.FileName)
{
//Return the other process instance.
return process;
}
}
}
//No other instance was found, return null.
return null;
}