我使用此代码获取我的PC中已打开端口的列表以及使用每个端口的应用程序。stringPort::GetListOfTcpPorts(){stringApplicationName="";stringresult="";stringaux="";stringRemotePort="";DWORD(WINAPI*pGetExtendedTcpTable)(PVOIDpTcpTable,PDWORDpdwSize,BOOLbOrder,ULONGulAf,TCP_TABLE_CLASSTableClass,ULONGReserved);MIB_TCPTABLE_OWNER_PID*pTCPIn
我在使用“GetExtendedTcpTable”时遇到了一些麻烦。当我尝试运行我的脚本时,我收到如下消息:AssertionError:[Error0]Theoperationcompletedsuccessfully脚本很少正常工作,我不明白这条消息,操作已完成,有什么问题吗?这是代码,我试着执行:fromctypesimport*fromctypes.wintypesimport*fromsocketimportinet_aton,inet_ntoa,htonsAF_INET=2TCP_TABLE_BASIC_LISTENER=0TCP_TABLE_BASIC_CONNECTIO
我是Go新手,需要在Windows中抓取网络信息。我尝试使用指向字节数组的指针作为参数调用GetExtendedTcpTable(),但调用后什么也得不到。var(iphelp=syscall.NewLazyDLL("iphlpapi.dll")tcptable=iphelp.NewProc("GetExtendedTcpTable"))var(buffer[20000]bytetable[20000]bytelengthint)res1,res2,err:=tcptable.Call(uintptr(unsafe.Pointer(&buffer)),uintptr(unsafe.Po