0
<DllImport("ieframe.dll", EntryPoint:="IEGetProtectedModeCookie")> _
Public Function IEGetProtectedModeCookie( _
    <[In](), MarshalAs(UnmanagedType.LPWStr)> ByVal lpszURL As String, _
    <[In](), MarshalAs(UnmanagedType.LPWStr)> ByVal lpszCookieName As String, _
    <MarshalAs(UnmanagedType.LPWStr)> ByVal pszCookieData As StringBuilder, _
    ByRef pcchCookieData As UInteger, _
    ByVal dwFlags As UInteger) As Integer
End Function

首先,这似乎与我的常规 API 声明非常不同

Declare Function InternetGetCookieEx Lib "wininet.dll" Alias "InternetGetCookieExA" (ByVal pchURL As String, ByVal pchCookieName As String, ByVal pchCookieData As String, ByRef pcchCookieData As System.UInt32, ByVal dwFlags As System.UInt32, ByVal lpReserved As Integer) As Boolean

而且它根本无法编译。未定义 StringBuilder。MarshalAs 未定义。在没有定义。我想知道我应该包含或导入什么来使它们工作。

4

1 回答 1

0

这是声明 API 函数的 .Net 方式。
Declare Function继承自VB6)

您需要导入System.TextSystem.Runtime.InteropServices

于 2013-06-09T11:38:50.180 回答