gecko clear cache history & cookies

后端 未结 2 926
隐瞒了意图╮
隐瞒了意图╮ 2021-02-10 03:53

Help! I use GeckoFx-Windows-10.0-0.6 for browser and xulrunner-10.0.en-US.win32. ( Visual Studio 2010 c# ) everything works well. But i need to

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-10 04:30

    To clear cookies you will need to query interface like this:

        if (MessageBox.Show("Do you want to delete cookies?", "About to delete all cookies", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
        {
            nsICookieManager CookieMan;
            CookieMan = Xpcom.GetService("@mozilla.org/cookiemanager;1");
            CookieMan = Xpcom.QueryInterface(CookieMan);
            CookieMan.RemoveAll();
        }
    

    An access to cache is denied during runtime brobably cause of security or such. Meaning you will need to find a way to delete these folders after you program closes etc. create another app for handling it.

提交回复
热议问题