检索工作站操作统计
#Include <NetShare.au3>
_Net_Share_StatisticsGetWrk([$sWorkStation = ""])
$sWorkStation | [可选参数] 指定 DNS 或 NetBIOS 远程服务器上执行函数的名称 如果此参数为空, 在本地计算机上使用. |
成功: | 返回以下格式的数组: | |
[ 0] - 统计数据收集的开始时间.该值存储为 00:00:00 以来经过的秒数, | ||
1970年1月1日 | ||
[ 1] - 工作站收到的字节 | ||
[ 2] - 工作站收到服务器消息块(SMBs) | ||
[ 3] - 已通过分页 I/O 读取的请求字节 | ||
[ 4] - 由非分页 I/O 请求读取的字节 | ||
[ 5] - 已被缓存 I/O 请求读取的字节 | ||
[ 6] - 由磁盘 I/O 请求读取的字节 | ||
[ 7] - 由工作站传送字节 | ||
[ 8] - 由工作站传送服务器信息块( SMB ) | ||
[ 9] - 已通过分页 I/O 请求的字节 | ||
[10] - 已被非分页 I/O 请求的书面字节 | ||
[11] - 已被缓存 I/O 请求的写入字节 | ||
[12] - 已被磁盘 I/O 请求的写入字节 | ||
[13] - 网络操作失败的开始 | ||
[14] - 网络操作失败的结束 | ||
[15] - 由工作站启动读操作 | ||
[16] - 随机存取读取的工作站启动 | ||
[17] - 读取请求已发送到工作站服务器 | ||
[18] - 两倍于服务器的读取请求已发送到工作站服务器 | ||
协议缓冲区大小. | ||
[19] - 不到服务器 1/4 的读取请求已发送到工作站服务器 | ||
协议缓冲区大小. | ||
[20] - 由工作站启动写操作 | ||
[21] - 随机存取写操作由工作站启动 | ||
[22] - 工作站写入请求发送到服务器 | ||
[23] - 两倍于服务器的工作站写入请求发送到服务器 | ||
协议缓冲区大小. | ||
[24] - 不到服务器 1/4 工作站写入请求发送到服务器 | ||
协议缓冲区大小. | ||
[25] - 由工作站发出但已被拒绝的原始读取请求 | ||
[26] - 由工作站发出但已被拒绝的原始写入请求 | ||
[27] - 网络工作站收到的错误 | ||
[28] - 工作站建立会话 | ||
[29] - 工作站试图建立 Ime 会话但失败 | ||
[30] - 已失败的连接 | ||
[31] - PCNET 已经成功连接 | ||
[32] - LanManager 20 已成功连接 | ||
[33] - LanManager 21 已成功连接 | ||
[34] - Windows NT 已成功连接 | ||
[35] - 网络服务器断开工作站次数 | ||
[36] - 会话已过期的工作站 | ||
[37] - 由工作站建立的网络连接 | ||
[38] - 工作站的网络连接失败 | ||
[39] - 没有完成的当前请求 | ||
失败: | 设置@error: |
在MSDN中搜索
#include <GUIConstantsEx.au3>
#include <NetShare.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $aInfo
; 创建 GUI
GUICreate("NetShare", 400, 300)
; 创建 memo 控件
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 获取工作站统计信息
$aInfo = _Net_Share_StatisticsGetWrk(@ComputerName)
MemoWrite("NetStatisticsGetWrk")
MemoWrite("Statistics started ......: " & $aInfo[0])
MemoWrite("Bytes received ..........: " & $aInfo[1])
MemoWrite("SMBs received ...........: " & $aInfo[2])
MemoWrite("Paging I/O bytes ........: " & $aInfo[3])
MemoWrite("Non-paging I/O bytes ....: " & $aInfo[4])
MemoWrite("Cache I/O bytes ..... ...: " & $aInfo[5])
MemoWrite("Disk I/O bytes ..........: " & $aInfo[6])
MemoWrite("Bytes transmitted .......: " & $aInfo[7])
MemoWrite("SMBs transmitted ........: " & $aInfo[8])
MemoWrite("Paging I/O bytes ........: " & $aInfo[9])
MemoWrite("Non-paging I/O bytes ....: " & $aInfo[10])
MemoWrite("Cache I/O bytes .........: " & $aInfo[11])
MemoWrite("Disk I/O bytes ..........: " & $aInfo[12])
MemoWrite("Failed ops begin ........: " & $aInfo[13])
MemoWrite("Failed ops completed ....: " & $aInfo[14])
MemoWrite("Read operations .........: " & $aInfo[15])
MemoWrite("Random access reads .....: " & $aInfo[16])
MemoWrite("Read requests sent ......: " & $aInfo[17])
MemoWrite("Read requests big .......: " & $aInfo[18])
MemoWrite("Read requests small .....: " & $aInfo[19])
MemoWrite("Write operations ........: " & $aInfo[20])
MemoWrite("Random access writes ....: " & $aInfo[21])
MemoWrite("Write requests sent .....: " & $aInfo[22])
MemoWrite("Write requests big ......: " & $aInfo[23])
MemoWrite("Write requests small ....: " & $aInfo[24])
MemoWrite("Denied raw reads ........: " & $aInfo[25])
MemoWrite("Denied raw writes .......: " & $aInfo[26])
MemoWrite("Network errors ..........: " & $aInfo[27])
MemoWrite("Sessions established ....: " & $aInfo[28])
MemoWrite("Failed sessions .........: " & $aInfo[29])
MemoWrite("Failed connections ......: " & $aInfo[30])
MemoWrite("PCNET connections .......: " & $aInfo[31])
MemoWrite("NetShare 20 connections .: " & $aInfo[32])
MemoWrite("NetShare 21 connections .: " & $aInfo[33])
MemoWrite("WinNT connections .......: " & $aInfo[34])
MemoWrite("Disconnects .............: " & $aInfo[35])
MemoWrite("Sessions expired ........: " & $aInfo[36])
MemoWrite("Connections made ........: " & $aInfo[37])
MemoWrite("Connections failed ......: " & $aInfo[38])
MemoWrite("Incomplete requests .....: " & $aInfo[39])
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite