Example #1
0
        /// <summary>
        /// Check Firefox Proxy Status
        /// </summary>
        /// <returns>If firefox proxy is enable retrn true</returns>
        private Boolean Check_Firefox_ProxyStatus()
        {
            Boolean       disable = false;
            DirectoryInfo RootInf = Get_FirefoxSettingPath();

            foreach (DirectoryInfo DInfo in RootInf.GetDirectories())
            {
                foreach (FileInfo FInfo in DInfo.GetFiles())
                {
                    if (FInfo.Name.ToLower() == "prefs.js")
                    {
                        if (is_Firefox_Proxy_Disable(FInfo) == true)
                        {
                            disable = true;
                            break;
                        }
                    }
                }
            }
            if (disable)
            {
                lbl_FirefoxStatus.Text           = "پراکسی غیر فعال است";
                lbl_FirefoxStatus.ForeColor      = Color.Red;
                btn_FirefoxProxy.BackgroundImage = Properties.Resources.firefox2;
                return(false);
            }
            else // if proxy is enable
            {
                lbl_FirefoxStatus.Text           = "پراکسی فعال است";
                lbl_FirefoxStatus.ForeColor      = Color.Green;
                btn_FirefoxProxy.BackgroundImage = Properties.Resources.firefox;
                return(true);
            }
        }
Example #2
0
        private void ChangeFirefoxProxy(Boolean EnableProxy)
        {
            DirectoryInfo RootInf = Get_FirefoxSettingPath();

            foreach (DirectoryInfo DInfo in RootInf.GetDirectories())
            {
                foreach (FileInfo FInfo in DInfo.GetFiles())
                {
                    if (FInfo.Name.ToLower() == "prefs.js")
                    {
                        EditPrefsJS(FInfo, Properties.Settings.Default.ProxyPort, Properties.Settings.Default.ProxyServerIP, EnableProxy);
                    }
                }
            }
        }