1.如何查看应用程序池对应的PID
1、在任务管理器中增加显示pid字段。就可以看到占用内存或者cpu最高的进程pid 2、在命令提示符下运行iisapp -a。注意,第一次运行,会提示没有js支持,点击确定。然后再次运行就可以了。这样就可以看到pid对应的应用程序池 3、到iis中察看该应用程序池对应的网站,就ok了 iisapp -a pid 可以查出对应的域名
反之 iisapp -p domain 查pid的语法iisapp [a/AppPoolName | /pAppPoolID]参数/a AppPoolName
指定特定应用程序池的名称。(可选项)
/p AppPoolID
按ID 号指定应用程序池。(可选项) 注释
2.怎样查找程序的PID参数
类型定义: Private Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long th32ModuleID As Long cntThreads As Long th32ParentProcessID As Long pcPriClassBase As Long dwFlags As Long szExeFile As String * MAX_PATH End Type 引入系统API: Private Declare Function Lib "kernel32" Alias "" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long VB定义下面一个函数 Private Function GetTargetProcessID(ByVal lpProcess As String) As Long Dim dwRet As Long Dim hSnapshot As Long Dim pe32 As PROCESSENTRY32 hSnapshot = (TH32CS_SNAPPROCESS, 0) pe32.dwSize = LenB(pe32) ProcessFirst hSnapshot, pe32 Do If InStr(pe32.szExeFile, lpProcess) > 0 Then dwRet = pe32.th32ProcessID Exit Do Else pe32.szExeFile = String(MAX_PATH, 0) End If Loop While (ProcessNext(hSnapshot, pe32)) CloseHandle (hSnapshot) GetTargetProcessID = dwRet End Function 调用如下: Pid=GetTargetProcessID("程序名.exe") '区分大小写。
转载请注明出处windows之家 » win10怎么看程序pid值