I'm currently working on getting cookie data with Csharp. I'm using DLLImport to invoke InternetGetCookie in wininet.dll, but when i try it the functions returns an ERROR_INSUFFICIENT_BUFFER (error code 122).
Can any one help me with this ?
This is the code of the Dll reference:
[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto, EntryPoint="InternetGetCookie")]
public static extern bool InternetGetCookie(string lpszUrl, string lpszCookieName,
ref StringBuilder lpszCookieData, ref int lpdwSize);
And this is the how i call the function:
InternetGetCookie("http://example.com", null, ref lpszCookieData, ref size)
Thanks.