c# - 启动单个控制台应用程序

标签 c# visual-studio visual-studio-2008

Possible duplicate: Run single instance of an application using Mutex

我在控制台应用程序上使用 C# 中的 VS 2008。不确定是否有任何可用的类(进程?)来限制一次只能运行一个控制台应用程序。

最佳答案

没有这样的类,但是你可以使用System.Threading.Mutex build 一个。

Mutex 是一种同步原语,也可用于进程间同步。

参见示例: How ensure that only one instance of an application will run?

关于c# - 启动单个控制台应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/943085/

相关文章:

c# - 在 EPPlus 中编写 Excel 文件

c++ - 如何让 ToolTip 出现在 float 的 CPaneDialog 的最前面?

c# - 如何在 C# 中将包含数组的字符串转换为数组

c++ - WIndows - 基于 list 的 ETW 提供程序问题

visual-studio - 如何让 Visual Studio 2010 自动创建可折叠区域

c++ - Visual Studio 2013 是否支持 Cuda 6?

c++ - 使用#line 控件时调试器的奇怪行为

.net - Visual Studio 2008 调试器不报告一些常见错误

c# - 在sql server中1列中使用2个参数更新多行

c# - 使用C#在asp.net中填充DataTable时出现System.OutOfMemoryException错误