internal CookieGetter(CookieStatus status) { if(status == null) { throw new ArgumentNullException("status"); } _cookieStatus = status; }
public ICookieGetter CreateDefaultCookieGetter() { string cookieFolder = Environment.GetFolderPath(Environment.SpecialFolder.Cookies); string lowFolder = System.IO.Path.Combine(cookieFolder, "low"); CookieStatus status = new CookieStatus(this.BrowserType.ToString(), lowFolder, this.BrowserType, PathType.Directory); return new IECookieGetter(status, false); }
public ICookieGetter CreateDefaultCookieGetter() { string path = SearchDirectory(); CookieStatus status = new CookieStatus("Lunascape6 Webkit", path, this.BrowserType, PathType.File); return new WebkitCookieGetter(status); }
/// <summary> /// CookieStatusからCookieGetterを復元する /// </summary> /// <param name="status"></param> /// <returns></returns> public static ICookieGetter CreateInstance(CookieStatus status) { ICookieGetter cookieGetter = CreateInstance(status.BrowserType); cookieGetter.Status.Name = status.Name; cookieGetter.Status.CookiePath = status.CookiePath; cookieGetter.Status.DisplayName = status.DisplayName; return cookieGetter; }
private ICookieGetter CreateCookieGetter() { string name = "Sleipnir3 Gecko"; string path = System.IO.Path.Combine(Utility.ReplacePathSymbols(DATAFOLDER), COOKEFILE_NAME); CookieStatus status = new CookieStatus(name, path, this.BrowserType, PathType.File); return new FirefoxCookieGetter(status); }
public ICookieGetter CreateDefaultCookieGetter() { string AppFolder = Environment.GetFolderPath(Environment.SpecialFolder.Cookies); AppFolder = Path.Combine(AppFolder, "Low"); // string AppFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"..\"); // string AppFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); CookieStatus status = new CookieStatus(this.BrowserType.ToString(), AppFolder, this.BrowserType, PathType.Directory); return new IE9CookieGetter(status, true); }
public static ICookieGetter CreateInstance(CookieStatus status) { ICookieGetter cookieGetter = CreateInstance(status.BrowserType); cookieGetter.Status.Name = status.Name; cookieGetter.Status.CookiePath = status.CookiePath; cookieGetter.Status.DisplayName = status.DisplayName; return(cookieGetter); }
public ICookieGetter CreateDefaultCookieGetter() { string path = Utility.ReplacePathSymbols(COOKIEPATH); if (!System.IO.File.Exists(path)) { path = null; } CookieStatus status = new CookieStatus(this.BrowserType.ToString(), path, this.BrowserType, PathType.File); return new Safari4CookieGetter(status); }
public ICookieGetter CreateDefaultCookieGetter() { string path = Utility.ReplacePathSymbols(COOKIEPATH); if (!System.IO.File.Exists(path)) { path = null; } CookieStatus status = new CookieStatus("Lunascape5 Gecko", path, this.BrowserType, PathType.File); return new Firefox3CookieGetter(status); }
public ICookieGetter CreateDefaultCookieGetter() { string name = string.Format("{0} {1}", BrowserType.ToString(), DefaultFolder); string path = Path.Combine(Path.Combine(Utility.ReplacePathSymbols(DATAFOLDER), DefaultFolder), COOKEFILE_NAME); if(!System.IO.File.Exists(path)) { path = null; } CookieStatus status = new CookieStatus(name, path, this.BrowserType, PathType.File); return new GoogleChromeCookieGetter(status); }
public ICookieGetter CreateDefaultCookieGetter() { string name = "Maxthon webkit"; string path = Utility.ReplacePathSymbols(COOKIEPATH); if(!System.IO.File.Exists(path)) { path = null; } CookieStatus status = new CookieStatus(name, path, this.BrowserType, PathType.File); return new GoogleChromeCookieGetter(status); }
private ICookieGetter CreateCookieGetter(FirefoxProfile prof) { string name = "PaleMoon"; string path = null; if (prof != null) { name += " " + prof.name; path = System.IO.Path.Combine(prof.path, COOKEFILE_NAME); } CookieStatus status = new CookieStatus(name, path, this.BrowserType, PathType.File); return new FirefoxCookieGetter(status); }
private ICookieGetter CreateCookieGetter(string prof) { string name = BrowserType.ToString(); string path = null; if(prof != null) { name += " " + Path.GetFileName(prof); path = System.IO.Path.Combine(prof, COOKEFILE_NAME); } CookieStatus status = new CookieStatus(name, path, this.BrowserType, PathType.File); return new GoogleChromeCookieGetter(status); }
/// <summary> /// GetCookieStatus()で取得した値を渡すことで状態を復元する /// </summary> /// <param name="cookieStatusBase64"></param> /// <returns></returns> public bool SetCookieStatus(string cookieStatusBase64) { try { byte[] bs = System.Convert.FromBase64String(cookieStatusBase64); IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); using (Stream stream = new MemoryStream(bs.Length)) { stream.Position = 0; stream.Write(bs, 0, bs.Length); stream.Position = 0; CookieStatus = formatter.Deserialize(stream) as Hal.CookieGetterSharp.CookieStatus; } this.RefreshBrowser(); } catch { return(false); } return(true); }
public ICookieGetter CreateDefaultCookieGetter() { string lowFolder = null; using(Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\LowRegistry\IEShims\NormalizedPaths", false)) { if(regkey != null) { string[] valueNames = regkey.GetValueNames(); string w81UpgradePath = null; foreach(string value in valueNames) { if(value.EndsWith("temp", StringComparison.CurrentCultureIgnoreCase)) { w81UpgradePath = value; } } if(!string.IsNullOrEmpty(w81UpgradePath)) { lowFolder = Path.Combine(Path.GetDirectoryName(w81UpgradePath), "INetCookies"); } } } if(string.IsNullOrEmpty(lowFolder)) { string path = Utility.ReplacePathSymbols(COOKIEPATH); try { if(0 < System.IO.Directory.GetFiles(path).Length) { lowFolder = path; } } catch { } } if(string.IsNullOrEmpty(lowFolder)) { string cookieFolder = Environment.GetFolderPath(Environment.SpecialFolder.Cookies); lowFolder = System.IO.Path.Combine(cookieFolder, "low"); } CookieStatus status = new CookieStatus(this.BrowserType.ToString(), lowFolder, this.BrowserType, PathType.Directory); return new IEEPMCookieGetter(status, false); }
private void SetBrowser() { if (browserThread.ThreadState == ThreadState.Running) { browserCancel = true; } lock (browserLock) { ICookieGetter cookieGetter = null; if (this.SelectedItem is ICookieGetter) { cookieGetter = (ICookieGetter)this.SelectedItem; } cookieGetterList.Clear(); cookieGetterList.AddRange(CookieGetter.CreateInstances(!_allBrowser)); if (cookieGetter != null) { CookieStatus = cookieGetter.Status; } bindingSource.ResetBindings(false); } browserSignal.Set(); }
private void Form1_Load(object sender, EventArgs e) { this.CookieStatus = Utility.Deserialize(SETTING_FILE) as CookieStatus; backgroundWorker1.RunWorkerAsync(); }
public IECookieGetter(CookieStatus status, bool checkSubDirectory) : base(status) { this._checkSubDirectory = true; }
public GoogleChromeCookieGetter(CookieStatus status) : base(status) { }
public SqlChromeCookieGetter(CookieStatus status) : base(status) { }
public ICookieGetter CreateDefaultCookieGetter() { string folder = Path.Combine(Utility.ReplacePathSymbols(DATAFOLDER), COOKEFILE_NAME); CookieStatus status = new CookieStatus("TungstenBlink", folder, this.BrowserType, PathType.File); return new GoogleChromeCookieGetter(status); }
public OperaCookieGetter(CookieStatus status) : base(status) { }
public IEEPMCookieGetter(CookieStatus status, bool checkSubDirectory) : base(status, checkSubDirectory) { }
public ICookieGetter CreateDefaultCookieGetter() { string cookieFolder = Environment.GetFolderPath(Environment.SpecialFolder.Cookies); CookieStatus status = new CookieStatus(this.BrowserType.ToString(), cookieFolder, this.BrowserType, PathType.Directory); return new IECookieGetter(status, true); }
/// <summary> /// GetCookieStatus()で取得した値を渡すことで状態を復元する /// </summary> /// <param name="cookieStatusBase64"></param> /// <returns></returns> public bool SetCookieStatus(string cookieStatusBase64) { try { byte[] bs = System.Convert.FromBase64String(cookieStatusBase64); IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); using (Stream stream = new MemoryStream(bs.Length)) { stream.Position = 0; stream.Write(bs, 0, bs.Length); stream.Position = 0; CookieStatus = formatter.Deserialize(stream) as Hal.CookieGetterSharp.CookieStatus; } this.RefreshBrowser(); } catch { return false; } return true; }
public Safari4CookieGetter(CookieStatus status) : base(status) { }
internal CookieGetter(ICookieImporter importer) { Importer = importer; Status = new CookieStatus(this, ConvertBrowserType(importer.SourceInfo.BrowserName)); }
public Firefox3CookieGetter(CookieStatus status) : base(status) { }
public WebkitCookieGetter(CookieStatus status) : base(status) { }