<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
没有编组这个没有任何东西的元帅。我怎么转过来?
这是正确的方法吗?
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