Find a task.

  • Thread starter Thread starter Empi
  • Start date Start date
E

Empi

Hi.

I programmed a tcp/ip server called banker.exe
How can I check if it is loaded?
Do I have to ping it?
I found no way to enumerate the tasks and get there names on the cf.

Got no Process.GetProcesses() or Process.ProcessName on the CF2.

Thanks.
 
You can P/Invoke the ToolHelp APIs to get a list of running processes. Or
use a wrapper e.g. OpenNETCF SDF (www.opennetcf.org)

Another solution would be the use of a Mutex:

server:

using(Mutex mutex = new Mutex(true, "application"))
{
// perform server stuff...
}

client:

out createdNew;
using(Mutex mutex = new Mutex(false, "application", out createdName))
{
Console.WriteLine("The server is {0}running", createdNew ? "not " :
string.Empty);
}
 
Thanks :-)

Tim Van Wassenhove said:
Another solution would be the use of a Mutex:

server:

using(Mutex mutex = new Mutex(true, "application"))
{
// perform server stuff...
}

client:

out createdNew;
using(Mutex mutex = new Mutex(false, "application", out createdName))
{
Console.WriteLine("The server is {0}running", createdNew ? "not " :
string.Empty);
}
 
Back
Top