Any Win32 process can perform some disk IO when you might not expect it to
do so, the registry is something that get accessed frequently and the also
CLR performs some IO because it's publishing performance counter data
through the memory mapped registry.
In your case the IO is induced by a performance counter data that's been
read when querying for process data counters (GetProcessesByName), this
has been corrected in v2.0 which doesn't use perfcounters any longer for
this.
Note also that what you are trying to achieve is not the right way to
check whether another instance of this application is running, you should
opt for a solution based on a named Mutex to prevent multiple instances.
Willy.
Andreas Zita said:
I found out the cause for this!
The two commented lines was causing it ... but i don't now why ...
/AZ
[STAThread]
static void Main()
{
//System.Diagnostics.Process[] p =
System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
//if (p.Length == 1)
Application.Run(new Form1());
}