关于mssqlserver 内存的问题![已经解决]
本帖最后由 wa18239 于 2011-7-30 11:09 编辑以下是测试,但都运行出错。#Include <WinAPIEx.au3>
Global $pid=ProcessExists ( "sqlservr.exe" ) ;//获取PID码
MsgBox(0, "SQL进程 PID 为", $pid )
If $pid = -1 Then Exit
Global $Data = _WinAPI_GetProcessMemoryInfo($pid)
Local $Data2 = ProcessGetStats($pid)
MsgBox(0, "SQL内存使用量为","_WinAPI_GetProcessMemoryInfo为:" & $Data/1024 & " K" )
MsgBox(0, "SQL内存使用量为", "ProcessGetStats为:"&$Data2/1024 & "K")是不是sqlservr.exe 不能读内存使用量吗?改成QQ.exe 又可以读QQ的内存使用量。
怎么提高权限呢。。。 自己的帖子自己顶 那我也帮你顶一下吧 也帮顶起来,呵呵
#Include <WinAPIEx.au3>
#include <lsasecur.au3>
$hToken = _SeImpersonateSystemContext()
MsgBox(0, "@UserName=" & @UserName, _SeFormatMsg("_SeImpersonateSystemContext"))
_main()
_SeCloseHandle($hToken)
_SeRevertToSelf()
MsgBox(0, "@UserName=" & @UserName, _SeFormatMsg("_SeRevertToSelf"))
Func _main()
Local $pid=ProcessExists ( "sqlservr.exe" ) ;//获取PID码
MsgBox(0, "SQL进程 PID 为", $pid )
If $pid = -1 Then Exit
$Data1 = _WinAPI_GetProcessMemoryInfo($pid)
If $Data1 = 0 Then
MsgBox(0,"error1",$Data1&@error)
endif
$Data2 = ProcessGetStats($pid)
If $Data2 = 0 Then
MsgBox(0,"error2",$Data2&@error)
endif
If IsArray($Data1) Then
MsgBox(0, "SQL内存使用量为","_WinAPI_GetProcessMemoryInfo为:" &$Data1/1024 & " K" )
Else
MsgBox(0,"error","不是数组")
EndIf
If IsArray($Data2) Then
MsgBox(0, "SQL内存使用量为", "ProcessGetStats为:"&$Data2/1024 & "K")
Else
MsgBox(0,"error","不是数组2")
EndIf
EndFunc
最后用P大的 lsasecur 解决,在此感谢P大{:face (88):}
页:
[1]