xeng

Typ:
neutral
Postów: 102
Zarejestrowany: May 2002
|
|
Znasz program ApiGuide ? Przedruk z tegoż programu.Dotyczy IP : Const MAXLEN_PHYSADDR = 8 Private Type MIB_IPNETROW dwIndex As Long dwPhysAddrLen As Long bPhysAddr(0 To MAXLEN_PHYSADDR - 1) As Byte dwAddr As Long dwType As Long End Type Private Declare Function GetIpNetTable Lib "Iphlpapi" (pIpNetTable As Byte, pdwSize As Long, ByVal bOrder As Long) As Long Private Declare Sub CopyMemory Lib "kernel32 " Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long) Private Sub Form_Load() Dim Listing() As MIB_IPNETROW, Ret As Long, Cnt As Long Dim bBytes() As Byte, bTemp(0 To 3) As Byte 'set the graphics mode of this form to persistent Me.AutoRedraw = True 'call the function to retrieve how many bytes are needed GetIpNetTable ByVal 0&, Ret, False 'if it failed, exit the sub If Ret <= 0 Then Exit Sub 'redimension our buffer ReDim bBytes(0 To Ret - 1) As Byte 'retireve the data GetIpNetTable bBytes(0), Ret, False 'copy the number of entries to the 'Ret' variable CopyMemory Ret, bBytes(0), 4 'redimension the Listing If Ret > 0 Then ReDim Listing(0 To Ret - 1) As MIB_IPNETROW 'show the data Me.Print "Contents of address mapping table (items: " + CStr(Ret) + " ) " For Cnt = 0 To Ret - 1 CopyMemory Listing(Cnt), bBytes(4 + 24 * Cnt), 24 CopyMemory bTemp(0), Listing(Cnt).dwAddr, 4 Me.Print " Item " + CStr(Listing(Cnt).dwIndex) Me.Print " address " + ConvertAddressToString(bTemp(), 4) Me.Print " physical address " + ConvertAddressToString(Listing(Cnt).bPhysAddr, Listing(Cnt).dwPhysAddrLen) Select Case Listing(Cnt).dwType Case 4 'Static Me.Print " type: Static" Case 3 'Dynamic Me.Print " type: Dynamic" Case 2 'Invalid Me.Print " type: Invalid" Case 1 'Other Me.Print " type: Other" End Select Next Cnt End Sub 'converts a byte array to a string Public Function ConvertAddressToString(bArray() As Byte, lLength As Long) As String Dim Cnt As Long For Cnt = 0 To lLength - 1 ConvertAddressToString = ConvertAddressToString + CStr(bArray(Cnt)) + "." Next Cnt ConvertAddressToString = Left$(ConvertAddressToString, Len(ConvertAddressToString) - 1) End Function [Koniec przedruku ] Standart exe i do code formy przekopiuj jak leci. Co do odczytywania zasobów udostepnionych umozliwia to np funkcja API GetOpenFileName zapis :GetSaveFileName(oczywiscie jezeli udostepniający tak to udostępnil lub jeżeli znasz hasło) Lub kontrolka ,która jest dodatkowo w VB : CommonDialog .Prawdopodobnie bo ja jej nie używałem jeszcze  Powodzenia w rozwiazniu problemu. I zarejestruj się.Korzyść z tego taka że wysłal bym Ci jakiś przykład.A tak kopiuj i domyslaj się jak cos nie będzie działać.
[Post edytowany dnia 16-08-2002 17:05 przez xeng]
_____________________________________________ Nic nie umiem i nic nie wiem.Jestem tuman bity w ciemie.
|