Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# how to start an application and detect if started

using System.Diagnostics;
using System.IO;
using System.Reflection.Assembly;

class Class
{
	if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(GetEntryAssembly().Location)).Count() > 1) 
	{
		Process.GetCurrentProcess().Kill();
	}
 
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: EF will not create columns RULE 
Csharp :: pyqt single instance 
Csharp :: model showing in scne view but not in game view 
Csharp :: c# remove 0 from string 
Csharp :: remove lines from textfile 
Csharp :: dynamic c# .add 
Csharp :: .net core get exe path 
Csharp :: Datagridview causing IndexOutOfRangeException when clicked upon 
Csharp :: six simple machines labeled 
Csharp :: .NET TLS 1.3 example 
Csharp :: c# array accessor 
Csharp :: how to create new function c# 
Csharp :: using autofac with automapper .net 6 with dependency injection 
Csharp :: vb.net how insert event inside an event 
Csharp :: c# int array add number 
Csharp :: is it possible to be palindrome 
Csharp :: c# only only 2 digits after decimal number double 
Csharp :: unity iOS app rating widget 
Csharp :: convert array to list c# 
Csharp :: c# is not marked as serializable 
Csharp :: can lightning strike the same place twice 
Csharp :: C# a program to reverse each word in the given string. 
Csharp :: random number between 1 and 100 c# 
Html :: marquee speed 
Html :: how to center text in svg 
Html :: link css html 
Html :: html long text three dots 
Html :: html h1 left align 
Html :: html file input file filter 
Html :: image drive inside html 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =