C#相当于VB DLL函数声明(InternetSetOption)?

时间:2011-05-10 07:15:57

标签: c# vb.net

这个VB代码的C#等价物是什么?

Private Declare Auto Function InternetSetOption Lib "wininet.dll" (ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean

1 个答案:

答案 0 :(得分:18)

Here it is

[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool InternetSetOption(
    IntPtr hInternet, 
    int dwOption, 
    IntPtr lpBuffer, 
    int dwBufferLength
);