FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

what function gives process id in C#

 


umeshtangnu
hi,
i am writing a http server programme and have an old code from a friend which uses getpid in error messages.
In the win32 API, GetCurrentProcessId() gives the handle of current funtion but what function is used in c#
plz help
MrBaseball34
You should be able to use that using a PINvoke:

C# Signature:
[DllImport("kernel32.dll")]
static extern uint GetCurrentProcessId();
umeshtangnu
thanks worked but isnt there ne thing inbuit in c#
MrBaseball34
You can use WMI:

http://www.codeproject.com/cs/system/win32processusingwmi.asp
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.