大家帮忙转API,谢谢!崩溃中。急!
转RasGetEntryProperties API函数。在http://www.pinvoke.net/default.aspx/rasapi32.RasGetEntryProperties
中转成
[DllImport("rasapi32.dll", CharSet = CharSet.Auto)]
private static extern UInt32 RasGetEntryProperties(
string lpszPhoneBook,
string szEntry,
IntPtr lpbEntry,
ref UInt32 lpdwEntrySize,
IntPtr lpb,
IntPtr lpdwSize);
但是这个函数的原型第三个参数是LPRASENTRY lpRasEntry,RasEntry结构体的缓冲区。修改如下:
[DllImport("rasapi32.dll", CharSet = CharSet.Auto)]
public static extern uint RasGetEntryProperties(
string lpszPhoneBook,
string szEntry,
[In,Out]RasEntry[] lpRasEntry,
ref UInt32 lpdwEntrySize,
IntPtr lpb,
IntPtr lpdwSize);
这两种形式都出现错误。
RasGetEntryProperties 函数的返回值是ERROR_INVALID_SIZE,Marshal.GetLastWin32Error的返回
值是ERROR_PROC_NOT_FOUND。
请帮忙!谢谢