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

那些marshalas的东西看起来很丑

为了比较,典型的 vb6 风格是:

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

没有元帅,这没有元帅,没有[in] thingy。我怎么转呢?

这是正确的方法吗?

Declare Function IEGetProtectedModeCookie Lib "ieframe.dll" (ByVal lpszURL As String, ByVal lpszCookieName As String, ByVal pszCookieData As System.Text.StringBuilder, ByRef pcchCookieData As UInteger, ByVal dwFlags As UInteger) As Integer
4

0 回答 0