Single instance of VB.NET application
The Process class provides functionality to track system processes in a system and to start and stop system processes. In order to determine if there are other instances of a VB.NET application running in the system , we have to get a list of all the processes running in the system and check if an instance of the application is in the list or not.
The System.Diagnostics namespace provides classes that allow you to interact with system processes, event logs, and performance counters. Process.GetProcessesByName to create an array of new Process components and associate them with all the process resources that are running the same executable file on the local computer
Dim _process() As Process _process = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName)
The above code _process() array receiving all the associated processes. If the _process() array contains more than one instance , then we should clear the instance already exist.
- What is Microsoft .Net Framework
- what are the functions of microsoft .net framework?
- Common Language Runtime in .Net Framework
- How to Common Language Runtime
- What is .Net Framework Class Library
- What is Common Language Specification
- What is Common Type System
- What is Microsoft Intermediate Language
- What is Portable Executable (PE) File Format
- What is Microsoft Just In Time Compiler
- How to Managed Code - Microsoft .Net Framework
- What is .Net Framework Metadata
- what is .Net Framework Assembly
- What is Assembly Manifest
- What is Global Assembly Cache
- What is a .Net Satellite Assembly?
- What are the contents of an Assembly?
- How to Private Assembly and Shared Assembly
- What is Microsoft .Net Strong Name
- What is .Net Namespaces
- What is Application Domain
- What is Code Access Security
- What is Garbage Collection
- .Net Threads