This isn't necessarily the same as using the CookieContainer.
If you are trying to set cookies that are used for the duration of a
request, then yes, this is the same.
However, InternetSetCookie was also used to write persistent cookies to
disk for IE/WinInet's use. Cookies that come back from
HttpWebRequest/HttpWebResponse will not be persisted to disk if an
expiration date is set.
If you have the desire to write cookies to this store, then you have to
call this method through the P/Invoke layer.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:Oz**************@TK2MSFTNGP05.phx.gbl...
Hello, RWF!
R> I am in the midst of converting a .NET 1.1 app to 2.0, and have run
R> across a section where the old programmers were using
R> [DllImport("wininet.dll")] to get to InternetSetCookie().
R> Is there a way to do this natively in .NET 2.0?
Look at HttpWebRequest.CookieContainer
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com