|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Read all cookies?Would I be right in saying that there are no classes in .Net to read and
parse all the cookies on a PC (not just those associated with a particular session), and that if I wanted to list them all (along with all the values), I'd have to parse them manually from the cookies directory? The latter's not too hard, but it's always nice of someone's already done the hard work for you. :-) Mark wrote:
> Would I be right in saying that there are no classes in .Net to read There's a Win32 API to parse all IE cookies:> and parse all the cookies on a PC (not just those associated with a > particular session), and that if I wanted to list them all (along > with all the values), I'd have to parse them manually from the > cookies directory? The latter's not too hard, but it's always nice of > someone's already done the hard work for you. :-) [DllImport("wininet.dll", CharSet=CharSet.Auto, SetLastError=true)] extern static bool InternetGetCookie ( string urlName, string cookieName, StringBuilder cookieData, ref int size); YOu'll probably find similar Mozilla APIs for Firefox/Mozilla. Cheers,
Show quote
"Joerg Jooss" <news-re***@joergjooss.de> wrote in message Perfect - thanks very much. :-)news:xn0dxbjo325ak92000@msnews.microsoft.com... > Mark wrote: > >> Would I be right in saying that there are no classes in .Net to read >> and parse all the cookies on a PC (not just those associated with a >> particular session), and that if I wanted to list them all (along >> with all the values), I'd have to parse them manually from the >> cookies directory? The latter's not too hard, but it's always nice of >> someone's already done the hard work for you. :-) > > There's a Win32 API to parse all IE cookies: > > [DllImport("wininet.dll", CharSet=CharSet.Auto, SetLastError=true)] > extern static bool InternetGetCookie ( > string urlName, > string cookieName, > StringBuilder cookieData, > ref int size); > > YOu'll probably find similar Mozilla APIs for Firefox/Mozilla. > Show quote
Show quote
"Mark" <m***@REMOVETHISBITmossywell.com> wrote in message I tried this out and as far as I can tell, InternetGetCookie expects a URL news:41eaafd3$0$26915$cc9e4d1f@news.dial.pipex.com... > "Joerg Jooss" <news-re***@joergjooss.de> wrote in message > news:xn0dxbjo325ak92000@msnews.microsoft.com... >> Mark wrote: >> >>> Would I be right in saying that there are no classes in .Net to read >>> and parse all the cookies on a PC (not just those associated with a >>> particular session), and that if I wanted to list them all (along >>> with all the values), I'd have to parse them manually from the >>> cookies directory? The latter's not too hard, but it's always nice of >>> someone's already done the hard work for you. :-) >> >> There's a Win32 API to parse all IE cookies: >> >> [DllImport("wininet.dll", CharSet=CharSet.Auto, SetLastError=true)] >> extern static bool InternetGetCookie ( >> string urlName, >> string cookieName, >> StringBuilder cookieData, >> ref int size); >> >> YOu'll probably find similar Mozilla APIs for Firefox/Mozilla. >> as one of the arguments. So, I have to know the URL to start with which means retrieving it manually from each cookie one by one. However, if I'm going to do that I might as well parse the whole cookie and forget about InternetGetCookie, I think. Is this right? Show quote > > Perfect - thanks very much. :-) > >> Cheers, >> -- >> http://www.joergjooss.de >> mailto:news-re***@joergjooss.de > > |
|||||||||||||||||||||||