Well.. i am really not understing almost nothing about apis in.net
first
i'd like to use GetTcpTable to get all active connections but it didn't work by the way i used to code.
I found a sample which works, but it modify the structure, and do not use MIB_TCPTABLE structure, but just MIB_TCPROW
its definitios are showed below:
Public Type MIB_TCPROW
dwState As Long
dwLocalAddr As Long
dwLocalPort As Long
dwRemoteAddr As Long
dwRemotePort As Long
End Type
Public Type MIB_TCPTABLE
dwNumEntries As Long
table(1600) As MIB_TCPROW
End Type
My questions: How to work with structures which have array members?
and i have other question:
How to declare a array, allocate memory for it, and assing this memory to my array, for example, i was trying to do that:
Dim T () as integer
Dim Ptr as IntPtr=Marsal.AllocHGlobal(12) '3 elements
t=Ctype( marshal.PtrToStructure(Ptr, gettype(Array)), Array)
t(0)=123
t(1)=321
t(2)=222
but it actually doesn't work
PLEASEE I NEED MANY HELPPPP!!!!!
I wanna know how to use GetTcpTable and SetTcpEntry, i wanna know how to allocate memomry for a array,...
first
i'd like to use GetTcpTable to get all active connections but it didn't work by the way i used to code.
I found a sample which works, but it modify the structure, and do not use MIB_TCPTABLE structure, but just MIB_TCPROW
its definitios are showed below:
Public Type MIB_TCPROW
dwState As Long
dwLocalAddr As Long
dwLocalPort As Long
dwRemoteAddr As Long
dwRemotePort As Long
End Type
Public Type MIB_TCPTABLE
dwNumEntries As Long
table(1600) As MIB_TCPROW
End Type
My questions: How to work with structures which have array members?
and i have other question:
How to declare a array, allocate memory for it, and assing this memory to my array, for example, i was trying to do that:
Dim T () as integer
Dim Ptr as IntPtr=Marsal.AllocHGlobal(12) '3 elements
t=Ctype( marshal.PtrToStructure(Ptr, gettype(Array)), Array)
t(0)=123
t(1)=321
t(2)=222
but it actually doesn't work
PLEASEE I NEED MANY HELPPPP!!!!!
I wanna know how to use GetTcpTable and SetTcpEntry, i wanna know how to allocate memomry for a array,...