登录
首页 » 其他 » C# 使用进程名禁止程序运行多次

C# 使用进程名禁止程序运行多次

于 2022-02-04 发布 文件大小:272.22 kB
0 120
下载积分: 2 下载次数: 1

代码说明:

C# 使用进程名禁止程序运行多次,   string moduleName = Process.GetCurrentProcess().MainModule.ModuleName; //获取当前活动进程的模块名称   string processName = System.IO.Path.GetFileNameWithoutExtension(moduleName);//返回指定路径字符串的文件名   Process[] processes = Process.GetProcessesByName(processName);//根据文件名创建进程资源数组   if (processes.Length > 1)//如果该数组长度大于1,说明多次运行   {    MessageBox.Show("本程序一次只能运行一个实例!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);//弹出提示信息    this.Close();//关闭当前窗体   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论


0 个回复

  • VB点歌系统,类似KTV程序
    一个基于VB的点歌系统,类似KTV程序,适用于网吧点歌、KTV包厢点歌等,程序分为服务端和客户端,运行于Windows平台,程序用到了以下控件:WinXPC Engine.ocx、系统托盘控件、IniEnV.ocx、msdxm.ocx。
    2022-03-04 03:41:01下载
    积分:1
  • 矩阵求逆,经典算法,主元高斯全左右弗兰…
    矩阵求逆,经典算法,全主元高斯约当法,经典源码,用途广泛-matrix inversion, classic algorithms, the main yuan Gaussian all about when France, classic source, a wide range of uses
    2022-03-28 18:05:36下载
    积分:1
  • Labview的入门教材,word版的,内容挺不错。
    Labview的入门教材,word版的,内容挺不错。-Labview entry materials, word version of the content very good.
    2022-07-24 05:33:46下载
    积分:1
  • javascript教程下部分
    javascript教程下部分-javascript course are partial
    2023-07-16 23:15:08下载
    积分:1
  • Create a storage structure of a given graph from the adjacency list and adjacenc...
    1 创建给定图的存储结构,从邻接表和邻接矩阵两种存储方式中选择一种。 2 对所创建的图进行深度和广度优先搜索遍历,给出遍历过程中的顶点序列。 3 求图的最小生成树,按构造顺序输出边的序列。(两种方法都要求!) 3 编写一个主函数,将上面函数连在一起,构成一个完整程序。 4 将实验源程序调试并运行。 -Create a storage structure of a given graph from the adjacency list and adjacency matrix are two ways to choose a store. Two pairs of maps created by the depth and breadth-first search traversal, given the culmination of the process of traversal sequence. 3 order to map the minimum spanning tree, according to the order of the output side of the sequence structure. (Both methods require!) 3 to prepare a main function, the above function together to form a complete program. 4 source debugging and running the experiment.
    2022-04-16 10:47:00下载
    积分:1
  • visual basic code. nice code. very good
    visual basic code. nice code. very good
    2023-06-21 04:05:03下载
    积分:1
  • 一个功能很全面占用空间的小商城程序,适合个人网上开店使用...
    一个功能很全面占用空间的小商城程序,适合个人网上开店使用-a very comprehensive functional space occupied a small place procedures for the use of personal Internet lines!
    2023-02-18 04:50:04下载
    积分:1
  • VPN commonly used terms, so the network, like you can check out.
    VPN常用术语,做网络的、喜欢的可以瞧瞧。-VPN commonly used terms, so the network, like you can check out.
    2023-08-07 15:20:03下载
    积分:1
  • This is a C Programming Document
    这是一个C++编程文档-This is a C Programming Document
    2022-01-26 06:57:18下载
    积分:1
  • VB版实用记事本(闹钟+日程提醒)程序源码
    VB版实用记事本(闹钟+提醒)程序源码,功能:1.闹钟(定时提醒/内容)2.记事(标题/时间/内容)。每条更新内容前都有一个符号。+为增加了新内容,-为去掉了的功能,*为在原有功能上进行的修改若某条更新内容下有缩进的内容则为本条更新内容的细节描述   FsNote 1.2.8(2006-11-3)    *修正了当天只有一条提醒的情况下启动程序会出错的BUG    *修正了当天只有一条提醒的情况下显示全天提醒时会显示一片空白的BUG   FsNote 1.2.7(2006-10-25)    +增加提醒时执行动作选项(仅显示提示框/播放声音/执行程序)    播放声音功能支持MP3/WMA/WAV/MID四种格式    执行程序可以选择EXE/COM/BAT三种格式    执行程序可以自行输入URL以定时打开某个网站    执行程序可以自行输入一个Email地址并以"mailto:"开头,可定时打开系统默认邮件程序发送邮件    *用户取消了提醒时自动将提醒选项复位(清除时间、提醒内容和提醒动作设置)
    2022-03-22 00:30:34下载
    积分:1
  • 696518资源总数
  • 105273会员总数
  • 10今日下载