开发者

Restore cookies in IE

I am looking for the AP开发者_开发百科I calls that would allow loading cookies into IE from say a text file. I believe this should be possible since IE has a import/export facility for cookies, feeds and favorites. When performing this kind of operation besides recreating the cookie txt files, index.dat must be also updated, otherwise the cookies won't work. Thanks!


To export the cookies from the source browser, use FindFirst/FindNextUrlCacheEntry() and specify COOKIE_CACHE_ENTRY in the INTERNET_CACHE_ENTRY_INFO structure you pass. Once you get the entry, you can persist all the relevant fields in whatever format you want, though the data is not guaranteed to be pure ASCII, so a text file will work as long as you use the proper encodings.

To import cookies from your data file, use SetUrlCacheEntryInfo().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜