获取正在运行的进程的进程ID [英] Getting Process ID of a my running process

查看:133
本文介绍了获取正在运行的进程的进程ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Windows Mobile应用程序,我想在运行时通过C#代码获取其进程ID(PID).
所以任何人都知道返回PID的函数吗?

I have windows mobile application, i want to get by C# code its Process ID (PID) while its running ..
so any one know function that return PID ?

推荐答案

在Process类上使用静态GetCurrentProcess()方法:
Use the static GetCurrentProcess() method on the Process class:
int nProcessID = Process.GetCurrentProcess().Id;


Process.GetCurrentProcess().Id


:)


这篇关于获取正在运行的进程的进程ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆