forward
global type n_adapters from nonvisualobject
end type
end forward
global type n_adapters from nonvisualobject
end type
global n_adapters n_adapters
type prototypes
Function ulong GetLastError( &
) Library "kernel32.dll"
Function ulong FormatMessage( &
ulong dwFlags, &
ulong lpSource, &
ulong dwMessageId, &
ulong dwLanguageId, &
Ref string lpBuffer, &
ulong nSize, &
ulong Arguments &
) Library "kernel32.dll" Alias For "FormatMessageA"
Function ulong GetAdaptersInfo ( &
Ref IP_ADAPTER_INFO pAdapterInfo[], &
Ref ulong pOutBufLen &
) Library "iphlpapi.dll" Alias For "GetAdaptersInfo"
Subroutine CopyMemory ( &
Ref blob Destination, &
long Source[], &
long Length &
) Library "kernel32.dll" Alias For "RtlMoveMemory"
Subroutine CopyMemory ( &
Ref integer Destination, &
blob Source, &
long Length &
) Library "kernel32.dll" Alias For "RtlMoveMemory"
end prototypes
forward prototypes
public function string of_getlasterror ()
public function string of_nbr2hex (unsignedlong aul_number, integer ai_digit)
public function boolean of_getadaptersinfo (ref string as_macaddress[], ref string as_description[], ref string as_adaptername[], ref string as_ipaddress[])
public function string of_getaddr ()
end prototypes
public function string of_getlasterror ();// SCRIPT: n_adapters.of_GetLastError
//
// PURPOSE: This function returns the last Windows API error.
//
// RETURN: Error message text
//
// -----------------------------------------
Constant ULong FORMAT_MESSAGE_FROM_SYSTEM = 4096
Constant ULong LANG_NEUTRAL = 0
String ls_buffer, ls_errmsg
ULong lul_error
lul_error = GetLastError()
ls_buffer = Space(255)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, &
lul_error, LANG_NEUTRAL, ls_buffer, 255, 0)
ls_errmsg = "Error# " + String(lul_error) + "~r~n~r~n" + ls_buffer
Return ls_errmsg
end function
public function string of_nbr2hex (unsignedlong aul_number, integer ai_digit);// SCRIPT: n_adapters.of_Nbr2Hex
//
// PURPOSE: This function converts a number to a hex string.
//
// ARGUMENTS: aul_number - A number to convert
// ai_digit - The number of hex digits expected
//
// RETURN: Hex string
//
// -----------------------------------------
详细解决方案
pb 获取ip地址解决思路
热度:39 发布时间:2016-04-29 07:31:45.0
相关解决方案