private void timer_cleardata_Tick(object sender, EventArgs e) // clear cache cookies history etc { nsIBrowserHistory historyMan = Xpcom.GetService <nsIBrowserHistory>(Gecko.Contracts.NavHistoryService); historyMan = Xpcom.QueryInterface <nsIBrowserHistory>(historyMan); historyMan.RemoveAllPages(); nsICookieManager CookieMan; CookieMan = Xpcom.GetService <nsICookieManager>("@mozilla.org/cookiemanager;1"); CookieMan = Xpcom.QueryInterface <nsICookieManager>(CookieMan); CookieMan.RemoveAll(); // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/imgICache Gecko.Cache.ImageCache.ClearCache(true); Gecko.Cache.ImageCache.ClearCache(false); // Gecko.Cache.CacheService.Clear(new CacheStoragePolicy()); nsICacheStorageService cache; cache = Xpcom.GetService <nsICacheStorageService>("@mozilla.org/netwerk/cache-storage-service;1"); try { cache.Clear(); } catch (Exception ex) { throw new ApplicationException("Could not clear cache:", ex); } imgICache icache; icache = Xpcom.GetService <imgITools>("@mozilla.org/image/tools;1").GetImgCacheForDocument(null); try { icache.ClearCache(false); } catch (Exception ex) { throw new ApplicationException("Could not clear image cache:", ex); } timer_cleardata.Stop(); }
private void clear_cookie() { nsIBrowserHistory historyMan = Xpcom.GetService <nsIBrowserHistory>(Gecko.Contracts.NavHistoryService); historyMan = Xpcom.QueryInterface <nsIBrowserHistory>(historyMan); historyMan.RemoveAllPages(); nsICookieManager CookieMan; CookieMan = Xpcom.GetService <nsICookieManager>("@mozilla.org/cookiemanager;1"); CookieMan = Xpcom.QueryInterface <nsICookieManager>(CookieMan); CookieMan.RemoveAll(); }
public BrowerGecko() { InitializeComponent(); rqAdword = new AdwordRequest(); _googleAdwordService = new GoogleAdwordService(); excutePath = Path.GetDirectoryName(Application.ExecutablePath); Xpcom.Initialize(excutePath + @"\Gecko"); //Xpcom.Initialize(@"F:\Sample\Gecko33\xulrunner-sdk\bin"); nsIBrowserHistory historyMan = Xpcom.GetService <nsIBrowserHistory>(Gecko.Contracts.NavHistoryService); historyMan = Xpcom.QueryInterface <nsIBrowserHistory>(historyMan); historyMan.RemoveAllPages(); // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/imgICache nsICookieManager CookieMan; CookieMan = Xpcom.GetService <nsICookieManager>("@mozilla.org/cookiemanager;1"); CookieMan = Xpcom.QueryInterface <nsICookieManager>(CookieMan); CookieMan.RemoveAll(); IPPublic = getPublicIP(); WriteLog(IPPublic.ToString()); WriteLogIP("Activated"); }
private void ViewLink() { if (numberURL <= lstAdwordConfigs.Count - 1) { if (lstAdwordConfigs != null && lstAdwordConfigs.Count > 0) { objAdwordConfig = lstAdwordConfigs[numberURL]; } string[] arrKeyWord = objAdwordConfig.KeyWord.Split(','); string[] arrclickLimit = objAdwordConfig.LinkQuantityClick.Split(','); if (arrclickLimit.Length > 0) { Random rdClickLimit = new Random(); clickLimit = rdClickLimit.Next(int.Parse(arrclickLimit[0]), int.Parse(arrclickLimit[1])); //MessageBox.Show("số lần click tối đa : " + clickLimit.ToString()); } if (arrKeyWord.Length > 0) { int i = 0; //rdKeyWord.Next(0,arrKeyWord.Count()-1] Random rdKeyWord = new Random(); string strQuery = HttpUtility.UrlEncode(arrKeyWord[i]); // geckoBrower.Dispose(); geckoBrower.Navigate(googleURL + strQuery); } } else { clickLinkTimer.Stop(); clickLinkTimer.Enabled = false; clickLinkTimer.Dispose(); //MessageBox.Show("Done Number URL : " + numberURL); WriteLogIP("NewIP"); //click adsen //clickAdsenTimer = new Timer(); //clickAdsenTimer.Interval = (1 * 20 * 1000); //clickAdsenTimer.Tick += new EventHandler(clickAdsenTimer_Tick); //clickAdsenTimer.Start(); ////Loop khi reset IP System.Threading.Thread.Sleep(3 * 60000); IPPublic = getPublicIP(); WriteLog(IPPublic.ToString()); if (!IPPublic.Equals(IPPublic.ToString())) { MessageBox.Show(IPPublic); } numberURL = 0; nsIBrowserHistory historyMan = Xpcom.GetService <nsIBrowserHistory>(Gecko.Contracts.NavHistoryService); historyMan = Xpcom.QueryInterface <nsIBrowserHistory>(historyMan); historyMan.RemoveAllPages(); //clear cache nsICookieManager CookieMan; CookieMan = Xpcom.GetService <nsICookieManager>("@mozilla.org/cookiemanager;1"); CookieMan = Xpcom.QueryInterface <nsICookieManager>(CookieMan); CookieMan.RemoveAll(); loop_ViewLinkWithIP(); } }