コード例 #1
0
ファイル: Main.cs プロジェクト: hugo-mirad/Leads-upload
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            //btnuploadtolive.Visible = true;
            //btnuploadtolive.Enabled = true;
            Cursor.Current = Cursors.WaitCursor;
            int u = 0;
            if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
            // if ((this.webBrowser1.ReadyState == WebBrowserReadyState.Complete) || (this.webBrowser1.ReadyState == WebBrowserReadyState.Interactive))
            {
                // for (int Loop = 100; Loop >= 5; Loop -= 10)
                //  {
                //  }
                int cscnt = 0;
                if (comboBox1.Text == "usadsciti")
                {
                    cscnt++;
                }
                if (comboBox1.Text == "www.adsciti.com")
                {
                    adccnt++;
                }

                if (comboBox1.Text == "CarPosts")
                {
                    #region CarPosts
                    if (webBrowser1.Url.ToString() == "http://www.carposts.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Free Ad");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.carposts.com/AutoEdit.php?SaveAuto=AddNew&Type=For Sale")
                    {
                        int cpst = 0;
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "If you are misusing our site than know that you have been logged.";
                            if (element.OuterText == InnerTxt)
                            {
                                cpst++;
                                this.Opacity = 100;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                                MessageBox.Show("This Site is not allowing to post ad with your ip address.");
                            }
                        }
                        if (cpst == 0)
                        {
                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;
                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.carposts.com/AutoEdit.php")
                    {
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "Use Agreement / Terms Conditions";
                                if (element.OuterText == InnerTxt)
                                {
                                    btnpostsubmit.Enabled = false;
                                    label31.Font = new System.Drawing.Font("Verdana", 8.0f,
                                    System.Drawing.FontStyle.Bold);
                                    label31.ForeColor = System.Drawing.Color.Red;
                                    btnuploadtolive.Enabled = true;
                                    btnuploadtolive.Visible = true;
                                }
                            }
                        }
                    }
                    #endregion
                }

                if (comboBox1.Text == "autoii")
                {
                    #region autoii
                    if (webBrowser1.Url.ToString() == "http://www.autoii.com/auto/index2.html")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.autoii.com/auto/AutoEdit.php?SaveAuto=AddNew&Type=For Sale")
                    {
                        int auti = 0;
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "If you are misusing our site than know that you have been logged.";
                            if (element.OuterText == InnerTxt)
                            {
                                auti++;

                                this.Opacity = 100;

                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                                MessageBox.Show("This Site is not allowing to post ad with your ip address.");
                            }
                        }

                        if (auti == 0)
                        {

                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;

                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }

                    }
                    if (webBrowser1.Url.ToString() == "http://www.autoii.com/auto/AutoEdit.php")
                    {
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {

                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "Use Agreement / Terms Conditions";
                                if (element.OuterText == InnerTxt)
                                {
                                    btnpostsubmit.Enabled = false;
                                    label31.Font = new System.Drawing.Font("Verdana", 8.0f,
                                    System.Drawing.FontStyle.Bold);
                                    btnuploadtolive.Enabled = true;
                                    btnuploadtolive.Visible = true;
                                }
                            }
                        }

                    }
                    #endregion
                }

                if (comboBox1.Text == "Clazorg")
                {
                    #region Claz
                    if (webBrowser1.Url.ToString() == "http://claz.org/classifieds/post")
                    {

                        if (clz == 1)
                        {
                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;

                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();

                        }
                    }
                    string check = string.Empty;
                    if ((webBrowser1.Url.ToString() != "http://claz.org/classifieds/post") )
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "Back";
                            if (element.OuterText == InnerTxt)
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                                System.Drawing.FontStyle.Bold);
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;
                                check = webBrowser1.Url.ToString();
                            }
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://claz.org/classifieds/save")
                    {
                        //if (webBrowser1.Url.ToString() == check)
                        //  {
                        btnuploadtolive.Enabled = false;
                        // }
                    }
                    #endregion
                }

                if (comboBox1.Text == "usadsciti")
                {
                    #region usadsciti
                    //circularProgressControl2.Start();
                    //pnlpostcardata.Visible = true;
                    //circularProgressControl2.Visible = true;
                    panel2.Visible = true;
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.usadsciti.com/publish-a-new-ad.htm")
                        {
                            if (cscnt == 1)
                            {
                                // if (adsty == 0)
                                // {
                                // {
                                foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                                {
                                    string InnerTxt = "TERMS OF SERVICE";
                                    if (element.OuterText == InnerTxt)
                                    {
                                        btnpostupload.Enabled = true;
                                        btnpostupload.Visible = true;
                                        this.Opacity = 100;
                                        circularProgressControl2.Stop();
                                        pnlpostcardata.Visible = true;
                                        circularProgressControl2.Visible = false;
                                        panel2.Visible = false;
                                        this.Refresh();
                                        cscnt++;
                                    }
                                }
                                //cscnt++;
                                // }

                            }
                        }

                        if (cscnt == 1)
                        {
                            //  string nk = webBrowser1.Url.ToString();
                            if (webBrowser1.Url.ToString() == "http://www.usadsciti.com/publish-a-new-ad.htm")
                            {

                                btnpostsubmit.Enabled = true;

                            }
                        }

                        if (webBrowser1.Url.ToString() != "http://www.usadsciti.com/publish-a-new-ad.htm")
                        {
                            int adc = 0;
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "TERMS OF SERVICE";
                                if (element.OuterText == InnerTxt)
                                {
                                    adc++;
                                }
                            }
                            if (adc >= 1)
                            { }
                            else
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                         System.Drawing.FontStyle.Bold);
                                label29.ForeColor = System.Drawing.Color.Red;
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;

                                circularProgressControl2.Stop();
                                pnlpostcardata.Visible = true;
                                label49.Visible = false;
                                panel2.Visible = false;
                                circularProgressControl2.Visible = false;

                                //}
                            }
                        }
                        #region old
                        //if (webBrowser1.Url.ToString() == "http://www.usadsciti.com/publish-a-new-ad.htm")
                        //{
                        //    if (asad == 1)
                        //    {

                        //        asad++;
                        //        circularProgressControl2.Start();
                        //        panel2.Visible = true;
                        //        circularProgressControl2.Visible = true;
                        //    }
                        //}

                        //if (webBrowser1.Url.ToString() != "http://www.usadsciti.com/publish-a-new-ad.htm")
                        //{
                        //    foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        //    {
                        //        string InnerTxt = "Report bad use or Spam";
                        //        if (element.OuterText == InnerTxt)
                        //        {
                        //            btnuploadtolive.Enabled = true;
                        //            btnuploadtolive.Visible = true;
                        //        }
                        //    }
                        //}
                        #endregion
                    }
                    #endregion
                }

                if (comboBox1.Text == "adsciti")
                {
                    #region adsciti
                    if (webBrowser1.Url.ToString() == "http://www.adsciti.com/publish-a-new-ad.htm")
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "TERMS OF SERVICE";
                            if (element.OuterText == InnerTxt)
                            {
                                btnpostupload.Enabled = true;
                                btnpostupload.Visible = true;

                                this.Opacity = 100;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                            }
                        }

                    }

                    if (webBrowser1.Url.ToString() != "http://www.adsciti.com/publish-a-new-ad.htm")
                    {
                        int adc = 0;
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "TERMS OF SERVICE";
                            if (element.OuterText == InnerTxt)
                            {
                                adc++;
                            }
                        }
                        if (adc >= 1)
                        {
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            btnpostsubmit.Enabled = true;
                        }
                        else
                        {
                            label31.Font = new System.Drawing.Font("Verdana", 8.0f,
                    System.Drawing.FontStyle.Bold);
                            label31.ForeColor = System.Drawing.Color.Red;
                            btnpostsubmit.Enabled = false;
                            btnuploadtolive.Visible = true;
                            btnuploadtolive.Enabled = true;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                        }
                    }
                    #endregion
                }

                if (comboBox1.Text == "UsNetads")
                {
                    #region usnetads
                    if (webBrowser1.Url.ToString() == "http://www.usnetads.com/")
                    {
                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();
                        GeneralFunction.LinkInvoke(webBrowser1, "Click Here to Post Ads");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.usnetads.com/post/post-free-ads.php")
                    {

                        btnpostupload.Enabled = true;
                        btnpostupload.Visible = true;
                        //btnpostupload.Enabled = true;
                        //btnpostupload.Visible = true;
                        //this.Opacity = 100;
                        //circularProgressControl2.Stop();
                        //circularProgressControl2.Visible = false;
                        //panel2.Visible = false;
                        //this.Refresh();
                    }
                    if (webBrowser1.Url.ToString() == "http://www.usnetads.com/post/post-free-ads-op.php")
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("p"))
                        {
                            string InnerTxt = "Congratulations! You have posted the advertisement successfully.";
                            if (element.OuterText.Contains(InnerTxt))
                            {

                                //GeneralFunction.LinkInvoke(webBrowser1, InnerTxt8);
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                        System.Drawing.FontStyle.Bold);
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Enabled = true;
                                btnuploadtolive.Visible = true;

                                //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                                //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                                //obUsedCarsInfo = objService.FindCarID(label10.Text);

                                //string InnerTxt8 = obUsedCarsInfo[0].YearOfMake.ToString() + " " + obUsedCarsInfo[0].Make.ToString() + " " + obUsedCarsInfo[0].Model.ToString();
                                //foreach (HtmlElement element1 in webBrowser1.Document.GetElementsByTagName("a"))
                                //{
                                //    if (element1.InnerText.Contains(InnerTxt8))
                                //   {

                                //   }

                                //}

                            }
                            else
                            {

                                //MessageBox.Show("Entered invalid data.Please check the data again");
                                //webBrowser1.Navigate("http://www.usnetads.com/post/post-free-ads.php");
                                // btnpostupload.Enabled = true;
                                // btnpostupload.Visible = true;
                            }
                        }

                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("div"))
                        {

                            string InnerTxt = "Failed to post your advertisement because of following error:";
                            string outer = element.OuterText;
                            //if (outer.Contains(InnerTxt))
                            if (outer.Contains(InnerTxt))
                            {
                                if (msg == 0)
                                {
                                    msg++;
                                    MessageBox.Show("Invalid Data Entered.Please Click start button Again and check the data.", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                                    webBrowser1.Navigate("http://www.usnetads.com/post/post-free-ads.php");
                                    btnpostupload.Enabled = true;
                                    btnpostupload.Visible = true;
                                    btnpostsubmit.Enabled = false;

                                }

                            }
                        }
                    }

                    //if (webBrowser1.Url.ToString() == "http://www.usnetads.com/post/post-free-ads-op.php")
                    //{
                    //  //  foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName(""))
                    //   // {

                    //         //if (element.OuterText.Contains(InnerTxt))
                    //         //{
                    //         //}
                    //   // }
                    //}
                    #endregion
                }

                else if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/sign-in.php")
                {
                    btnpostupload.Enabled = true;
                    btnpostupload.Visible = true;
                    this.Opacity = 100;
                    circularProgressControl2.Stop();
                    circularProgressControl2.Visible = false;
                    panel2.Visible = false;
                    this.Refresh();
                }
                else if (webBrowser1.Url.ToString() == data5)
                {
                    button4.Visible = true;
                    button4.Enabled = true;
                    button6.Visible = true;
                    button6.Enabled = true;
                }
                //---------------justgoodcars Start-------------
                if (comboBox1.Text == "JustgoodCars")
                {
                    #region justgoodcars
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/members_index.php")
                    {
                        if (comboBox1.Text == "JustgoodCars")
                        {
                            if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/members_index.php")
                            {
                                //     foreach (HtmlElement htmlElement in webBrowser1.Document.Links)
                                //   {
                                //         linkItem = htmlElement.GetAttribute("HREF").ToString();
                                //    }
                                //// }
                                // }
                                //   else
                                //    {
                                GeneralFunction.HfClickInvoke(webBrowser1, "/images/btn-logout.gif");
                                webBrowser1.Navigate("http://www.justgoodcars.com/sign-in.php");
                                comboBox1.Text = "";
                                webBrowser1.Navigate("");
                            }
                            //}
                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {

                        //for make and model
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise.php")
                        {
                            IWebSites objClass = new JustgoodCars();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {

                        //for car details
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise1.php")
                        {
                            IWebSites objClass = new JustgoodCars();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                            GeneralFunction.ButtonClickInvoke(webBrowser1, "submit");

                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        //to click image upload button
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise_preview.php")
                        {
                            if (ic == 0)
                            {
                                IWebSites objClass = new JustgoodCars();
                                objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            }

                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise_preview.php")
                        {
                            //to click free button
                            if (ic == 2)
                            { }
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/adverts_edit_image-upload.php")
                    {
                        //to click try upload button
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Try this Simple Upload Tool");
                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        //to click browsebutton  image
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/adverts_edit_image.php")
                        {
                            ic++;
                            if (ic == 1)
                            {
                                GeneralFunction.FileUploadInvoke(webBrowser1, "userfile");
                                btnpostsubmit.Enabled = true;
                                btnpostsubmit.Visible = true;
                            }
                            //to click back button after uploading image
                            if (ic == 2)
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                                System.Drawing.FontStyle.Bold);
                                btnpostsubmit.Enabled = false;
                            }
                            if (ic == 2)
                            {
                                if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/adverts_edit_image.php")
                                {
                                    GeneralFunction.ButtonClickInvokeValue(webBrowser1, "< Back");
                                }
                            }
                        }
                    }
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise_preview.php")
                        {
                            if (ic == 2)
                            {
                                f++;
                                if (f == 1)
                                {
                                    GeneralFunction.ButtonClickInvokeValue(webBrowser1, "FREE >");//SubmitButton for GoLive justgoodcars
                                    webBrowser1.Navigate("http://www.justgoodcars.com/members/members_index.php");
                                    webBrowser1.Navigate("http://www.justgoodcars.com/members/adverts.php");
                                }
                            }
                        }
                    }

                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/adverts.php")
                        {

                            GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "View / Edit");
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                        }
                    }
                    if (webBrowser1.Url.ToString() == data5)
                    {
                    }
                    #region old
                    //if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    //{
                    //    if (ic == 3)
                    //    {
                    //        if (webBrowser1.Url.ToString() == "http://www.justgoodcars.com/members/advertise_preview.php")
                    //        {
                    //            btnlive.Enabled = true;
                    //            int i = 0;
                    //            GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "View / Edit");
                    //            foreach (HtmlElement htmlElement in webBrowser1.Document.Links)
                    //            {
                    //                i++;
                    //                if (i == 8)
                    //                {

                    //                    string tabItem = htmlElement.InnerText;
                    //                    linkItem = htmlElement.GetAttribute("HREF").ToString();
                    //                    label26.Font = new System.Drawing.Font("Verdana", 8.0f,
                    //         System.Drawing.FontStyle.Bold);

                    //                    webBrowser1.Navigate("http://www.justgoodcars.com/members/members_index.php");

                    //                    //webBrowser1.Navigate("http://www.justgoodcars.com/");

                    //                }
                    //                btnSubmit.Enabled = true;
                    //            }
                    //        }
                    //    }
                    //}
                    #endregion
                    #endregion
                }
                //--------------justgoodcars End----------------

                //-----------------kugli start-------------------------
                if (comboBox1.Text == "kugli")
                {
                    #region kugli
                    if (webBrowser1.Url.ToString() == "http://www.kugli.com/business/def/post-edit-classified-ad/catid/2/")
                    {
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;

                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }
                    }

                    if (Kug == 1)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.kugli.com/business/def/post-edit-classified-ad/catid/2/")
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new Kugli();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        }
                    }
                    #endregion
                }
                //-----------------kugli end-------------------------

                //-----------------Jeanza start-------------------------
                if (comboBox1.Text == "jeanza")
                {
                    #region jeanza
                    if (webBrowser1.Url.ToString() == "http://www.jeanza.com/publish-a-new-ad.htm")
                    {
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            if (jnga == 0)
                            {
                                btnpostupload.Enabled = true;
                                btnpostupload.Visible = true;

                                this.Opacity = 100;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                            }
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.jeanza.com/publish-a-new-ad.htm")
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                            {
                                string InnerTxt = "Click here for Free Classified Ads Website.";
                                if (element.OuterText == InnerTxt)
                                {
                                    label29.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                                    btnpostsubmit.Enabled = false;
                                    btnuploadtolive.Visible = true;
                                    btnuploadtolive.Enabled = true;
                                }
                            }
                        }
                    }
                    if (jnga == 1)
                    {
                        // btnuploadtolive.Visible = true;
                        //  btnuploadtolive.Enabled = true;
                    }
                    #endregion
                }
                //-----------------Jeanza end-------------------------

                //-----------------Classifiedvally start-------------------------
                if (comboBox1.Text == "classifiedsvalley")//done
                {
                    #region classifiedsvalley old
                    //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/")
                    //{
                    //    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    //    {
                    //        btnpostupload.Enabled = true;
                    //        btnpostupload.Visible = true;

                    //        this.Opacity = 100;
                    //        circularProgressControl2.Stop();
                    //        circularProgressControl2.Visible = false;
                    //        panel2.Visible = false;
                    //        this.Refresh();
                    //    }
                    //}
                    ////
                    //if (Globalstname.stname == "oregon")
                    //    Globalstname.stname = "oklahoma";
                    ////
                    //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/")
                    //{
                    //    //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //    //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //    //obUsedCarsInfo = objService.FindCarID(label10.Text);
                    //    //IWebSites objClass = new classifiedsvalley();
                    //    //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                    //    GeneralFunction.LinkInvoke(webBrowser1, "Change City");
                    //    circularProgressControl2.Stop();
                    //    panel2.Visible = false;
                    //    circularProgressControl2.Visible = false;
                    //    MessageBox.Show("Please Select City Manually");
                    //}
                    ////
                    //if (Globalstname.stname == "oklahoma")
                    //    Globalstname.stname = "oregon";
                    ////
                    //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/choose-classified-ad-location.php")
                    //{ }
                    //string valyurl = webBrowser1.Url.ToString();
                    //if (Globalstname.stname != "california")
                    //{
                    //    if (valyurl.Contains("_"))
                    //    {
                    //        // http://www.classifiedsvalley.com/alaska/10_Homer/
                    //        int index1 = valyurl.IndexOf(".com/");
                    //        int end1 = valyurl.Length;
                    //        valyurl = valyurl.ToString().Substring(index1, end1 - index1);
                    //        valyurl = valyurl.Replace(".com/", "");
                    //        int index2 = valyurl.IndexOf("/");
                    //        int end2 = valyurl.Length;
                    //        valyurl = valyurl.ToString().Substring(index2, end2 - index2);
                    //        valyurl = valyurl.Replace("/", "");
                    //        int index3 = 0;
                    //        int end3 = valyurl.IndexOf("_");
                    //        cityno = valyurl.ToString().Substring(index3, end3 - index3);
                    //        cityno = cityno.Replace("_", "");
                    //    }
                    //}

                    //if (Globalstname.stname == "california")
                    //{
                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/")
                    //    {
                    //        btnpostupload.Enabled = true;
                    //        btnpostupload.Visible = true;

                    //        this.Opacity = 100;
                    //        circularProgressControl2.Stop();
                    //        circularProgressControl2.Visible = false;
                    //        panel2.Visible = false;
                    //        this.Refresh();

                    //        GeneralFunction.LinkInvoke(webBrowser1, "Change City");
                    //    }

                    //    if (valyurl.Contains("_"))
                    //    {

                    //        // http://www.classifiedsvalley.com/alaska/10_Homer/
                    //        int index1 = valyurl.IndexOf(".com/");
                    //        int end1 = valyurl.Length;
                    //        valyurl = valyurl.ToString().Substring(index1, end1 - index1);
                    //        valyurl = valyurl.Replace(".com/", "");
                    //        int index2 = 0;
                    //        int end2 = valyurl.Length;
                    //        valyurl = valyurl.ToString().Substring(index2, end2 - index2);
                    //        valyurl = valyurl.Replace("/", "");

                    //        int index3 = 0;
                    //        int end3 = valyurl.IndexOf("_");
                    //        cityno = valyurl.ToString().Substring(index3, end3 - index3);
                    //        cityno = cityno.Replace("_", "");

                    //    }

                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/choose-classified-ad-location.php")
                    //    {

                    //        MessageBox.Show("Please Select City Manually");
                    //    }

                    //    //  http://www.classifiedsvalley.com/372_San_Francisco/
                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + valyurl + "/")
                    //    {
                    //        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    //    }

                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "index.php?view=post&cityid=" + cityno + "&lang=en")
                    //    {
                    //        GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "Vehicles");
                    //    }
                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4")
                    //    {

                    //        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //        obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //        int year = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                    //        if (rb_Vans.Checked)
                    //        {
                    //            GeneralFunction.LinkInvoke(webBrowser1, "Vans");
                    //        }
                    //        else if (rb_Trucks.Checked)
                    //        {
                    //            GeneralFunction.LinkInvoke(webBrowser1, "Trucks");
                    //        }
                    //        else
                    //        {
                    //            if (year < 1991)
                    //            {
                    //                GeneralFunction.LinkInvoke(webBrowser1, "Classic Cars");
                    //            }
                    //            else
                    //                GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                    //        }
                    //    }
                    //    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65"
                    //     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67"
                    //     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69"
                    //     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68")
                    //    {

                    //        if (cvy == 0)
                    //        {
                    //            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                    //            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //            obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //            GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");

                    //            circularProgressControl2.Stop();
                    //            panel2.Visible = false;
                    //            circularProgressControl2.Visible = false;

                    //            IWebSites objClass = new classifiedsvalley();
                    //            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //            btnpostsubmit.Visible = true;
                    //            btnpostsubmit.Enabled = true;

                    //            cvy++;
                    //        }
                    //    }

                    //    if ((webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    //     || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&"))
                    //    //if (webBrowser1.Url.ToString() != "http://www.classifiedsvalley.com/" + Globalstname.stname );
                    //    {
                    //        int clsfd = 0;
                    //        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                    //        {
                    //            string InnerTxt = "Back to Home";
                    //            if (element.OuterText == InnerTxt)
                    //            {
                    //                clsfd++;
                    //                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                    //                System.Drawing.FontStyle.Bold);

                    //                label29.ForeColor = System.Drawing.Color.Red;

                    //                btnpostsubmit.Enabled = false;
                    //                btnuploadtolive.Visible = true;
                    //                btnuploadtolive.Enabled = true;
                    //            }
                    //        }
                    //        if (clsfd == 0)
                    //        {
                    //            if (vlly == 0)
                    //            {
                    //                vlly++;

                    //                MessageBox.Show("Enter Security Code and Check All the fields ", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    //                GeneralFunction.CheckedInvoke(webBrowser1, "agree");

                    //                btnpostsubmit.Enabled = true;

                    //                GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                    //            }
                    //        }

                    //    }
                    //}
                    //if (valyurl.Contains("_"))
                    //{

                    //}
                    //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + valyurl + "/")
                    //{

                    //    circularProgressControl2.Start();
                    //    panel2.Visible = true;
                    //    circularProgressControl2.Visible = true;

                    //    GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");

                    //}

                    //string test = "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "index.php?view=post&cityid=" + cityno + "&lang=en";
                    //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "index.php?view=post&cityid=" + cityno + "&lang=en")
                    //{
                    //    //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                    //    //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //    //obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //    // http://www.classifiedsvalley.com/kentucky/index.php?view=post&cityid=1&lang=en
                    //    //IWebSites objClass = new classifiedsvalley();
                    //    //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);

                    //    GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "Vehicles");
                    //}

                    //if ((webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4") || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=2"))
                    //{
                    //    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //    obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //    int yearnw = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                    //    if (rb_Vans.Checked)
                    //    {
                    //        GeneralFunction.LinkInvoke(webBrowser1, "Vans");
                    //    }
                    //    else if (rb_Trucks.Checked)
                    //    {
                    //        GeneralFunction.LinkInvoke(webBrowser1, "Trucks");
                    //    }
                    //    else
                    //    {
                    //        if (yearnw < 1991)
                    //        {
                    //            GeneralFunction.LinkInvoke(webBrowser1, "Classic Cars");
                    //        }
                    //        else
                    //        {
                    //            //if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4")
                    //            //{
                    //            //    GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                    //            //}
                    //            //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //            //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //            //obUsedCarsInfo = objService.FindCarID(label10.Text);
                    //            ////http://www.classifiedsvalley.com/kentucky/?view=post&cityid=1&lang=en&catid=4
                    //            //IWebSites objClass = new classifiedsvalley();
                    //            //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                    //            GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                    //        }
                    //    }
                    //}
                    //if ((webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=2&subcatid=17")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=2&subcatid=21")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/" + "?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68"))
                    //{
                    //    // http://www.classifiedsvalley.com/kentucky/?view=post&cityid=1&lang=en&catid=4&subcatid=65
                    //    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    //    {
                    //        if (cvy == 0)
                    //        {

                    //            cvy++;
                    //            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                    //            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //            obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //            circularProgressControl2.Stop();
                    //            panel2.Visible = false;
                    //            circularProgressControl2.Visible = false;

                    //            GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                    //            IWebSites objClass = new classifiedsvalley();
                    //            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //            btnpostsubmit.Visible = true;
                    //            btnpostsubmit.Enabled = true;
                    //        }

                    //    }
                    //}

                    ////  http://www.classifiedsvalley.com/alabama/index.php?view=post&cityid=1&lang=en&catid=2&subcatid=17&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&
                    //string sfsd = "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=1&lang=en&catid=4&subcatid=65&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&";
                    //string sfsd1 = "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&";
                    //string sfsd2 = "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&";

                    //if ((webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=65&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=69&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=67&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=4&subcatid=68&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=2&subcatid=17&adid=0&imgid=0&countryid=0&areaid=0&pos=0&picid=0&page=0&foptid=0&eoptid=0&pricemin=0&pricemax=0&")
                    // || (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/" + Globalstname.stname + "/index.php?view=post&cityid=" + cityno + "&lang=en&catid=2&subcatid=21&adid=&imgid=&countryid=&areaid=&pos=&picid=&page=&foptid=&eoptid=&pricemin=&pricemax=&"))
                    ////if (webBrowser1.Url.ToString() != "http://www.classifiedsvalley.com/" + Globalstname.stname );
                    //{
                    //    int clsfd = 0;
                    //    foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                    //    {
                    //        string InnerTxt = "Back to Home";
                    //        if (element.OuterText == InnerTxt)
                    //        {
                    //            clsfd++;
                    //            label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                    //            System.Drawing.FontStyle.Bold);

                    //            label29.ForeColor = System.Drawing.Color.Red;

                    //            btnpostsubmit.Enabled = false;
                    //            btnuploadtolive.Visible = true;
                    //            btnuploadtolive.Enabled = true;
                    //        }
                    //    }
                    //    if (clsfd == 0)
                    //    {
                    //        if (vlly == 0)
                    //        {
                    //            vlly++;

                    //            MessageBox.Show("Enter Security Code and Check All the fields ", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    //            GeneralFunction.CheckedInvoke(webBrowser1, "agree");

                    //            btnpostsubmit.Enabled = true;

                    //            GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                    //        }
                    //    }

                    //}
                    #endregion
                    #region classifiedsvalley
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    string username = comboBox2.Text;
                    Char[] seprt = { '@' };
                    string[] splitemail = username.Split(seprt);

                    username = splitemail[0].ToString();
                    string statename1 = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Register");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/register.php")
                    {
                        GeneralFunction.SetTextValue(webBrowser1, "c[firstname]", "uce");
                        GeneralFunction.SetTextValue(webBrowser1, "c[lastname]", "urve");
                        GeneralFunction.SetTextValue(webBrowser1, "c[address]", obUsedCarsInfo[0].City.ToString() + " " + obUsedCarsInfo[0].State.ToString() + " " + obUsedCarsInfo[0].Zip.ToString());
                        GeneralFunction.SetTextValue(webBrowser1, "c[city]", obUsedCarsInfo[0].City.ToString());
                        GeneralFunction.SetTextValue(webBrowser1, "c[zip]", obUsedCarsInfo[0].Zip.ToString());
                        SelectOption(webBrowser1, statename1, "c[state]");
                        GeneralFunction.SetTextValue(webBrowser1, "c[email]", comboBox2.Text);
                        GeneralFunction.SetTextValue(webBrowser1, "c[email_verifier]", comboBox2.Text);
                        GeneralFunction.SetTextValue(webBrowser1, "c[username]", username);
                        GeneralFunction.SetTextValue(webBrowser1, "c[password]", textBox2.Text);
                        GeneralFunction.SetTextValue(webBrowser1, "c[password_confirm]", textBox2.Text);
                        GeneralFunction.RadioSetValue(webBrowser1, "c[business_type]", "1");
                        GeneralFunction.RadioSetValue(webBrowser1, "c[agreement]", "yes");
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "submit");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/register.php?b=1")
                    {
                        //foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("h1"))
                        //{
                        //    if (webBrowser1.Document.GetElementById("h1").InnerText == "Confirm Your Registration")
                        //        webBrowser1.Navigate("http://www.gmail.com");
                        //    else
                        //        webBrowser1.Refresh();
                        //}
                            //Txt_Url.Text = "http://www.gmail.com";
                        Txt_Url.Visible = true;
                        Navigate_btn.Visible = true;
                    }
                    //if (webBrowser1.Url.ToString() == "https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/&scc=1&ltmpl=default&ltmplcache=2&emr=1")
                    //{
                    //    if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    //    {
                    //        GeneralFunction.SetTextValue(webBrowser1, "Email", "*****@*****.**");
                    //        GeneralFunction.SetTextValue(webBrowser1, "Passwd", "carsales*123*");
                    //        GeneralFunction.ButtonClickInvoke(webBrowser1, "signIn");
                    //        Txt_Url.Visible = true;
                    //        Navigate_btn.Visible = true;
                    //    }
                    //}
                    if (webBrowser1.Url.ToString().Contains("b=3"))
                    //webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart"
                    //|| webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=4"
                    //||
                    {
                        Txt_Url.Visible = false;
                        Navigate_btn.Visible = false;
                        GeneralFunction.LinkInvoke(webBrowser1, "CLICK HERE");
                        //GeneralFunction.LinkInvoke(webBrowser1, "Post an ad (free)");
                        //GeneralFunction.LinkInvoke(webBrowser1, "New Classified");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post an ad (free)");
                        GeneralFunction.LinkInvoke(webBrowser1, "New Classified");
                    }
                    if(webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "New Classified");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=new&main_type=classified")
                    {
                        GeneralFunction.spanLinkInvoke1(webBrowser1, "Vehicles");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=15&action=process")
                    {
                        if (rb_Trucks.Checked)
                        {
                            GeneralFunction.spanLinkInvoke1(webBrowser1, "Trucks");
                        }
                        else if (rb_Vans.Checked)
                        {
                            GeneralFunction.spanLinkInvoke1(webBrowser1, "Minivans");
                        }
                        else
                        GeneralFunction.spanLinkInvoke1(webBrowser1, "Cars");
                        //spanLinkInvoke1(webBrowser1, "Trucks");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=212&action=process")
                    {
                        webBrowser1.Navigate("http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=212&c=terminal&action=process");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=196&action=process"
                     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=305&action=process"
                     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&main_type=classified&step=classified:category&b=212&c=terminal&action=process")
                    {
                        IWebSites ob = new classifiedsvalley1();
                        GeneralFunction.SetDropDownNameandValue(webBrowser1, "b[classified_length]", "62");
                        ob.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        //GeneralFunction.SetTextValue(webBrowser1, "b[classified_title]", obUsedCarsInfo[0].YearOfMake.ToString() + " " + obUsedCarsInfo[0].Make.ToString() + " " + obUsedCarsInfo[0].Model.ToString());
                        //GeneralFunction.SetMultiTextValue(webBrowser1, "b[description]", "Make: Ford\r\nModel: F250\r\nyear: 1995\r\nPrice: $7000\r\nMileage: 95000.00\r\n\n\nDescription: Runs and drives w ell 95,000 original miles 7.3 Turbo diesel have canopy for it as w ell 4253816458..!! If intrested\r\nContact : 4253816458..!!!For More Details: http://UnitedCarExchange.com/a1/1995-Ford-F250-271755505317");
                        //GeneralFunction.SetTextValue(webBrowser1, "b[question_value][92]", "jagadeesh");
                        //GeneralFunction.SetTextValue(webBrowser1, "b[question_value][93]", "jagadeesh");
                        //GeneralFunction.SetTextValue(webBrowser1, "b[price]", "jagadeesh");
                        //GeneralFunction.ButtonClickInvoke(webBrowser1, "submit");
                        //GeneralFunction.SetTextValue(webBrowser1, "b[classified_title]", "jagadeesh");

                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=process&main_type=classified&step=classified:details")
                    {
                        //spanLinkInvoke2(webBrowser1, "normalUploaderShowLink");
                        GeneralFunction.spanLinkInvoke1(webBrowser1, "click here");
                        GeneralFunction.FileUploadInvoke(webBrowser1, "d[1]");
                        GeneralFunction.FileUploadInvoke(webBrowser1, "d[2]");
                        GeneralFunction.FileUploadInvoke(webBrowser1, "d[3]");
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "submit");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=process&main_type=classified&step=images:upload_images"
                     || webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=process&main_type=classified&step=images:upload_images&useLegacyUploader=1&no_ssl_force=1")
                    {
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "c[no_images]");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=process&main_type=classified&step=images:upload_images&useLegacyUploader=1&no_ssl_force=1")
                    {
                        GeneralFunction.ButtonClickBody2(webBrowser1, "Process Queue");
                        btnuploadtolive.Enabled = true;
                        btnuploadtolive.Visible = true;
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsvalley.com/index.php?a=cart&action=process&main_type=cart&step=cart")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                    }
                    //GeneralFunction.LinkInvoke(webBrowser1, statename);
                    #endregion
                }
                //-----------------Classifiedvally end-------------------------

                //-----------------Classifiedciti start-------------------------
                if (comboBox1.Text == "classifiedsciti")
                {
                    #region classifiedsciti
                    circularProgressControl2.Start();
                    circularProgressControl2.Visible = true;
                    panel2.Visible = true;
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsciti.com/publish-a-new-ad.htm")
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "TERMS OF SERVICE";
                            if (element.OuterText == InnerTxt)
                            {
                                tabControl1.Enabled = true;
                                btnpostupload.Enabled = true;
                                btnpostupload.Visible = true;
                                this.Opacity = 100;
                                pnlpostcardata.Visible = true;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                            }
                        }

                    }
                    if (webBrowser1.Url.ToString() != "http://www.classifiedsciti.com/publish-a-new-ad.htm")
                    {
                        if (webBrowser1.Url.ToString() != "http://just98.justhost.com/suspended.page/disabled.cgi/classifiedsciti.com")
                        {

                            int clc = 0;
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "TERMS OF SERVICE";
                                if (element.OuterText == InnerTxt)
                                {
                                    clc++;
                                }
                            }
                            if (clc >= 1)
                            {
                            }
                            else
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                                System.Drawing.FontStyle.Bold);
                                label29.ForeColor = System.Drawing.Color.Red;

                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;
                                circularProgressControl2.Stop();
                                panel2.Visible = false;
                                circularProgressControl2.Visible = false;
                                //}
                            }
                        }
                    }

                    if (webBrowser1.Url.ToString() == "http://just98.justhost.com/suspended.page/disabled.cgi/classifiedsciti.com")
                    {
                        circularProgressControl2.Stop();
                        panel2.Visible = false;
                        circularProgressControl2.Visible = false;
                        MessageBox.Show("This Site under maintance.Please select another Site.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    }
                    #endregion
                }

                //-----------------Classifiedciti end-------------------------

                //-----------------USA.Motoseller start-------------------------
                if (comboBox1.Text == "usa.motoseller.com")
                {
                    #region usa.motoseller.com
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=10&amp;c=a*is*1")
                        {
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "click here to log out";
                                if (element.OuterText == InnerTxt)
                                {
                                    moto++;
                                    GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "click here to log out");
                                }
                            }
                            if (moto == 0)
                            {

                                btnpostupload.Enabled = true;
                                btnpostupload.Visible = true;

                                this.Opacity = 100;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                            }

                            //foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            //{

                            //    string fgf = webBrowser1.Url.ToString();
                            //    string InnerTxt = "click here to log out";
                            //    if (element.OuterText == InnerTxt)
                            //    {
                            //        GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "click here to log out");

                            //        webBrowser1.Navigate("");
                            //        comboBox1.Text = "";
                            //    }

                            //    else
                            //    {

                            //        btnpostupload.Enabled = true;
                            //        btnpostupload.Visible = true;
                            //    }

                            //}

                            // btnpostsubmit.Visible = true;
                            // btnpostsubmit.Enabled = true;
                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=10")
                        {
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "click here to log out";
                                if (element.OuterText == InnerTxt)
                                {
                                    moto++;
                                    GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "click here to log out");
                                }
                            }

                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=10")
                        {
                            if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                            {
                                IWebSites objClass = new Motoseller();
                                objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            }
                        }
                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php")
                        {

                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "Post a FREE Ad!";
                                if (element.OuterText == InnerTxt)
                                {

                                    GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "Post a FREE Ad!");
                                    moto = 0;
                                    //if(int motosl==0)
                                    //{
                                    motosl++;
                                    MessageBox.Show("Please Click Start Button Again", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                    label27.Font = new System.Drawing.Font("Verdana", 8.0f,
                                    System.Drawing.FontStyle.Regular);
                                    //}
                                }
                            }

                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1")
                        {

                            IWebSites objClass = new Motoseller();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&b=302&set_cat=1")
                        {

                            IWebSites objClass = new Motoseller();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&b=307&c=category&set_cat=1")
                        {
                            statenamemoto = GetStatesMotoseller.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                            if (statenamemoto != "")
                            {
                                char[] spldata = { ',' };
                                string[] msplit = statenamemoto.Split(spldata);

                                stNamemoto = msplit[0].ToString();
                                // stName1moto = stNamemoto + " ".ToString();
                                stcdemoto = msplit[1].ToString();
                                GeneralFunction.LinkInvokeMotoSellerStateName(webBrowser1, "category_links", stNamemoto);
                                //IWebSites objClass = new Motoseller();
                                //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                            }

                        }
                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&b=" + stcdemoto + "&c=category&set_cat=1")
                        {

                            circularProgressControl2.Stop();
                            panel2.Visible = false;
                            circularProgressControl2.Visible = false;
                            label49.Visible = false;

                            IWebSites objClass = new Motoseller();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;

                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&set_details=1")
                        {
                            if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                            {
                                GeneralFunction.FileUploadInvoke(webBrowser1, "d[1]");

                                btnpostsubmit.Enabled = false;
                            }

                        }
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&set_details=1")
                            {

                                GeneralFunction.ButtonClickInvoke(webBrowser1, "c[no_images]");
                            }
                        }

                        if (webBrowser1.Url.ToString() == "http://usa.motoseller.com/c/sys.php?a=1&set_images=1")
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Approve this ad");
                            btnuploadtolive.Visible = true;
                            btnuploadtolive.Enabled = true;
                            label28.Font = new System.Drawing.Font("Verdana", 8.0f,
                            System.Drawing.FontStyle.Bold);
                            // GeneralFunction.LinkInvokeClassifiedValley(webBrowser1, "Log Out");
                        }
                    }
                    #endregion
                }
                //-----------------USA.Motoseller End-------------------------

                //-----------------American start-------------------------
                if (comboBox1.Text == "American-classifieds.net")
                {
                    #region American-classifieds.net
                    if (webBrowser1.Url.ToString() == "http://www.american-classifieds.net/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ads");

                    }
                    if (webBrowser1.Url.ToString() == "http://www.american-classifieds.net/postad.php")
                    {
                        //if (webBrowser1.Document.GetElementById("title").InnerText != "")
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "POST REGULAR AD");
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.american-classifieds.net/postad.php?submittype=0&categ=")
                    {

                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {

                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;
                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }

                    }

                    if (comboBox1.Text == "American-classifieds.net")
                    {
                        int amc = 0;
                        int amc1 = 0;

                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            if (webBrowser1.Url.ToString() != "http://www.american-classifieds.net/postad.php")
                            {
                                if (webBrowser1.Url.ToString() != "http://www.american-classifieds.net/")
                                {
                                    if (webBrowser1.Url.ToString() != "http://www.american-classifieds.net/postad.php")
                                    {
                                        if (webBrowser1.Url.ToString() != "http://www.american-classifieds.net/postad.php?submittype=0&categ=")
                                        {
                                            if (webBrowser1.Url.ToString() != "http://www.american-classifieds.net/")
                                            {
                                                if (amc1 == 0)
                                                {

                                                    circularProgressControl2.Start();
                                                    circularProgressControl2.Visible = true;
                                                    panel2.Visible = true;
                                                    btnpostsubmit.Enabled = false;
                                                    string fgf = webBrowser1.Url.ToString();
                                                    string InnerTxt = "Accent List";
                                                    if (element.OuterText == InnerTxt)
                                                    {
                                                        if (amc == 0)
                                                        {
                                                            amc1++;
                                                            label31.Font = new System.Drawing.Font("Verdana", 8.0f,
                                                             System.Drawing.FontStyle.Bold);
                                                            circularProgressControl2.Stop();
                                                            circularProgressControl2.Visible = false;
                                                            panel2.Visible = false;
                                                            label31.ForeColor = System.Drawing.Color.Red;
                                                            btnpostsubmit.Enabled = false;
                                                            btnuploadtolive.Visible = true;
                                                            btnuploadtolive.Enabled = true;
                                                            amc++;
                                                        }
                                                    }

                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        if (amc >= 1)
                        {
                        }
                        else
                        {
                            if (amc1 == 1)
                            {
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                btnpostsubmit.Enabled = false;
                                btnpostupload.Enabled = true;

                                MessageBox.Show("Email has been used already.Please select the site again and change emailId.");

                            }

                        }

                        //string recorded = webBrowser1.Url.ToString();
                        //if (recorded.Contains("recorded"))
                        //{

                        //}

                        if (webBrowser1.Url.ToString() == "http://www.american-classifieds.net/postad.php")
                        {
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("div"))
                            {
                                string InnerTxt = "An ad was posted from your IP address less than 5 minutes ago.";

                                if (element.OuterText == InnerTxt)
                                {
                                }
                                string fxb = element.OuterText;
                                //  if (element.InnerText.Contains(InnerTxt))
                                //  {

                                // }
                            }
                        }

                    }
                    #endregion

                }
                //-----------------American End-------------------------

                //-----------------classifiedsforfree start-------------------------
                if (comboBox1.Text == "Classifiedsforfree")
                {
                    #region Classifiedsforfree
                    Globaltxtemail.txtemail = comboBox2.Text;
                    Globalpwd.pwd = textBox2.Text;
                    int cfree = 0;

                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/")
                    {

                        //  webBrowser1.Navigate("http://www.classifiedsforfree.com/post-ad/State.htm");
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new ClassifiedsForFree();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Post Ad");

                    }

                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/Account/Login?ReturnUrl=/Post")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Register");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/Post")
                    {

                        if (cfreeimg == 0)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new ClassifiedsForFree();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                            cfreeimg++;
                        }
                    }

                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/Account/Register")
                    {

                        if (cff == 0)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            cff++;

                            IWebSites objClass = new ClassifiedsForFree();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;
                        }
                        if (cff == 1)
                        {
                            //GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                        }
                        circularProgressControl2.Stop();
                        panel2.Visible = false;
                        circularProgressControl2.Visible = false;
                        label49.Visible = false;

                        // GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");

                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/#")
                    {
                        GeneralFunction.SpanInnerText(webBrowser1, "US States");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/post-ad/State.htm")
                    {
                        btnpostupload.Enabled = true;
                        btnpostupload.Visible = true;

                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();
                    }

                    if (webBrowser1.Url.ToString() == "http://www.classifiedsforfree.com/submit-ad/State.htm")
                    {
                        if (webBrowser1.Url.ToString() != "http://www.classifiedsforfree.com/post-ad/State.htm")
                        {
                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "YouTube.com";
                                if (element.OuterText == InnerTxt)
                                {
                                    cfree++;
                                    MessageBox.Show("Please check the fields again before clicking submit");
                                }
                            }
                            if (cfree == 0)
                            {
                                foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("div"))
                                {
                                    string fg = element.InnerHtml;

                                    btnpostsubmit.Enabled = false;
                                    btnuploadtolive.Visible = true;
                                    btnuploadtolive.Enabled = true;
                                    label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                                    System.Drawing.FontStyle.Bold);

                                    label29.ForeColor = System.Drawing.Color.Red;
                                }
                            }
                        }
                    }
                    #endregion
                }
                //-----------------classifiedsforfree End-------------------------

                //-----------------epage End-------------------------
                if (comboBox1.Text == "Epage" || comboBox1.Text == "www.epage.com")
                {
                    #region epage old
                    //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //obUsedCarsInfo = objService.FindCarID(label10.Text);
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post/c0/"
                    //|| (webBrowser1.Url.ToString().Contains("http://epage.com/js/post;") && webBrowser1.Url.ToString().Contains("jsessionid")))
                    //{
                    //    btnpostupload.Enabled = true;
                    //    btnpostupload.Visible = true;
                    //    this.Opacity = 100;
                    //    circularProgressControl2.Stop();
                    //    circularProgressControl2.Visible = false;
                    //    panel2.Visible = false;
                    //    this.Refresh();
                    //}
                    //if (webBrowser1.Url.ToString() != "http://epage.com/js/post")
                    //{
                    //    if (webBrowser1.Url.ToString() != "http://epage.com/js/post?c=0&b=0&process=2&cnum=1100300"
                    //     || webBrowser1.Url.ToString() != "http://epage.com/js/post?c=0&b=0&process=2&cnum=1102000")
                    //    {
                    //        if (webBrowser1.Url.ToString() != "http://epage.com/js/post/c0/")
                    //        {
                    //            if (webBrowser1.Url.ToString() != "http://epage.com/js/post?c=0")
                    //            {
                    //                if (epg == 0)
                    //                {
                    //                    IWebSites objClass = new epage();
                    //                    objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //                    epg1++;
                    //                    epg++;
                    //                }
                    //            }
                    //        }
                    //    }
                    //}

                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0&b=0&process=2&cnum=1100300" || webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0&b=0&process=2&cnum=1102000")
                    //{
                    //    IWebSites objClass = new epage();
                    //    objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //    circularProgressControl2.Stop();
                    //    circularProgressControl2.Visible = false;
                    //    panel2.Visible = false;
                    //}

                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post")
                    //{
                    //    if (epg1 == 1)
                    //    {
                    //        IWebSites objClass = new epage();
                    //        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //        btnpostsubmit.Enabled = true;
                    //        btnpostsubmit.Visible = true;
                    //    }
                    //}
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0")
                    //{
                    //    if (subepg == 1)
                    //    {
                    //        GeneralFunction.ButtonClickByValue(webBrowser1, "Continue");
                    //        epglst++;
                    //        subepg++;
                    //        label29.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                    //        //IWebSites objClass = new epage();
                    //        //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                    //    }
                    //}
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post")
                    //{
                    //    GeneralFunction.Submit(webBrowser1, " Register ");
                    //}
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0")
                    //{
                    //    if (epglst == 1)
                    //    {
                    //        GeneralFunction.ButtonClickByValue(webBrowser1, "Yes");
                    //        epg1++;
                    //        if (epg1 == 2)
                    //        {
                    //            circularProgressControl2.Stop();
                    //            panel2.Visible = false;
                    //            circularProgressControl2.Visible = false;
                    //        }
                    //    }
                    //}
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/post")
                    //{
                    //    if (epg1 == 3)
                    //    {
                    //        btnpostsubmit.Enabled = false;
                    //    }
                    //}
                    //string urlck = webBrowser1.Url.ToString();
                    //if (urlck.Contains("mi"))
                    //{
                    //    btnuploadtolive.Visible = true;
                    //    btnuploadtolive.Enabled = true;
                    //}
                    //if (webBrowser1.Url.ToString() == "http://epage.com/js/account/n0/")
                    //{
                    //    GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                    //}
                    #endregion
                    #region epage new
                    if (webBrowser1.Url.ToString() == "http://epage.com/js/post/c0/")
                    {
                        GeneralFunction.RadioSetValue(webBrowser1, "place", "pp1100000,0,1100000,Vehicles");
                        GeneralFunction.ButtonClickByValue(webBrowser1, "Continue");
                    }
                    else if (webBrowser1.Url.ToString() == "http://epage.com/js/post" || webBrowser1.Url.ToString().Contains("jsessionid"))
                    {
                        epagei++;
                    }
                    else if (webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0&b=0&process=2&cnum=1100300")
                    {
                        GeneralFunction.ButtonClickByValue(webBrowser1, "Continue");
                    }
                    else if (webBrowser1.Url.ToString() == "http://epage.com/js/post?c=0")
                    {
                        epagej++;
                    }
                    else if (webBrowser1.Url.ToString() == "http://epage.com/js/account/n0/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                    }
                    //else if (webBrowser1.Url.ToString() == "http://epage.com/js/account/n0/")
                    //{
                    //    GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                    //}
                    else if (webBrowser1.Url.ToString().Contains("mi"))
                    {
                        btnuploadtolive.Visible = true;
                        btnuploadtolive.Enabled = true;
                    }
                    if (epagej == 1)
                    {
                        GeneralFunction.ButtonClickByValue(webBrowser1, "Continue");
                    }
                    else if (epagej > 1)
                    {
                        //GeneralFunction.ButtonClickByValue(webBrowser1, "Yes");
                    }
                    if (epagei == 1)
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new epage();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    else if (epagei == 2)
                    {
                        GeneralFunction.Submit(webBrowser1, " Register ");
                    }
                    else if (epagei == 3)
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new epage();

                        string username = comboBox2.Text;
                        Char[] seprt = { '@' };
                        string[] splitemail = username.Split(seprt);
                        username = splitemail[0].ToString();
                        GeneralFunction.SetTextValue(webBrowser1, "loginuserid", username);
                        GeneralFunction.SetTextValue(webBrowser1, "loginemail", comboBox2.Text);
                        GeneralFunction.SetTextValue(webBrowser1, "loginpasswd", textBox2.Text);
                        GeneralFunction.SetTextValue(webBrowser1, "loginfirstname", username);
                        GeneralFunction.SetTextValue(webBrowser1, "loginlastname", username);
                        GeneralFunction.SetDropDownNameandValue(webBrowser1, "logincountry", "151000");
                        GeneralFunction.SetTextValue(webBrowser1, "loginzip", obUsedCarsInfo[0].Zip.ToString());
                    }
                    else if (epagei > 3)
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new epage();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    #endregion
                }
                //-----------------epage End-------------------------

                //------------Highland start---------------------------
                if (comboBox1.Text == "highlandclassifieds")//done
                {
                    #region highlandclassifieds
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Yes");
                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/csp?csp=45757")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post a New Ad");
                        //if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post/c45757")
                        //{
                        // HLepglst++;
                        btnpostupload.Enabled = true;
                        btnpostupload.Visible = true;
                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();

                    }
                    // }

                    if (webBrowser1.Url.ToString() != "http://highlandclassifieds.com/js/post")
                    {
                        if (webBrowser1.Url.ToString() != "http://highlandclassifieds.com/js/post?c=0&b=0&process=2&cnum=1100300"
                         || webBrowser1.Url.ToString() != "http://highlandclassifieds.com/js/post?c=0&b=0&process=2&cnum=1102000")
                        {
                            if (webBrowser1.Url.ToString() != "http://highlandclassifieds.com/js/post/c0/")
                            {
                                if (webBrowser1.Url.ToString() != "http://ww1.highlandclassifieds.com/js/post")
                                {
                                    if (HLepg == 0)
                                    {
                                        IWebSites objClass = new highlandclassifieds();
                                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                                        HLepg1++;
                                        HLepg++;
                                    }
                                }
                            }
                        }
                    }
                    string urlck = webBrowser1.Url.ToString();
                    if (urlck.Contains("mi"))
                    {
                        btnuploadtolive.Visible = true;
                        btnuploadtolive.Enabled = true;

                    }

                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post?c=45757&b=45757&process=2&cnum=1100300"
                     || webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post?c=45757&b=45757&process=2&cnum=1102000")
                    {

                        IWebSites objClass = new highlandclassifieds();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                    }

                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post")
                    {
                        if ((HLepg1 == 1) || (HLepg1 == 2) || (HLepg1 == 3) || (HLepg1 == 4))
                        {
                            IWebSites objClass = new highlandclassifieds();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Continue");

                            if (HLepg1 == 3)
                            {
                                btnpostupload.Enabled = false;
                                btnpostsubmit.Enabled = true;
                                btnpostsubmit.Visible = true;
                            }
                            if (HLepg1 == 4)
                            {
                                label28.Font = new System.Drawing.Font("Verdana", 8.0f,
                         System.Drawing.FontStyle.Bold);
                                btnpostsubmit.Enabled = false;
                            }
                            HLepg1++;

                        }
                    }
                    //if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post?c=0")
                    //{
                    //    if (HLsubepg == 1)
                    //    {
                    //        GeneralFunction.ButtonClickByValue(webBrowser1, "Continue");
                    //        HLepglst++;
                    //        HLsubepg++;
                    //        label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                    //        System.Drawing.FontStyle.Bold);
                    //        //IWebSites objClass = new epage();
                    //        //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);

                    //    }
                    //}
                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post")
                    {
                        GeneralFunction.Submit(webBrowser1, " Register ");
                    }
                    //if (webBrowser1.Url.ToString() == "{http://ww1.highlandclassifieds.com/js/post?c=45757")
                    //{

                    //        GeneralFunction.ButtonClickByValue(webBrowser1, "Yes");
                    //        HLepg1++;
                    //        if (HLepg1 == 2)
                    //        {
                    //            circularProgressControl2.Stop();
                    //            pnlpostcardata.Visible = false;
                    //            panel2.Visible = false;
                    //            circularProgressControl2.Visible = false;
                    //        }
                    //}
                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post?c=45757")
                    {
                        //if (hgcl == 0)
                        //{

                        hgcl++;

                        //if (hgcl == 1)
                        //{
                        //string price = obUsedCarsInfo[0].Price.ToString();
                        //price = "$" + price;
                        // GeneralFunction.SetTextValue(webBrowser1, "price", price);
                        GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Continue");
                        //}

                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();

                        //     GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Continue");

                        // btnpostsubmit.Enabled = false;
                        // }
                    }
                    if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/account/c45757")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                    }

                    //if (webBrowser1.Url.ToString() == "http://ww1.highlandclassifieds.com/js/post")
                    //{

                    //    if (HLepg1 == 3)
                    //    {
                    //        btnpostsubmit.Enabled = false;
                    //        btnuploadtolive.Visible = true;
                    //        btnuploadtolive.Enabled = true;
                    //    }
                    //}

                    #endregion
                }
                //------------Highland End----------------------------

                if (comboBox1.Text == "classifiededition")
                {
                    #region classifiededition
                    string stName = string.Empty;
                    string stName1 = string.Empty;
                    string stNam = string.Empty;
                    string stcde = string.Empty;
                    string statename = string.Empty;
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    statename = GetEditionState.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                    if (statename != "")
                    {
                        char[] spldata = { ',' };
                        string[] msplit = statename.Split(spldata);
                        stName = msplit[0].ToString();
                        stNam = msplit[0].ToString();
                        if (stName == "New York")
                        {
                            stName = stName.Replace(" ", "_");

                        }
                        stName1 = stNam + " ".ToString();
                        stcde = msplit[1].ToString();
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            if (webBrowser1.Url.ToString() == "http://www.classifiededition.com/")
                            {
                                btnpostupload.Visible = true;
                                btnpostupload.Enabled = true;

                                this.Opacity = 100;
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                                this.Refresh();
                            }
                            if (webBrowser1.Url.ToString() == "http://www.classifiededition.com/-2_United_States/")
                            {

                                //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                                //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                                //obUsedCarsInfo = objService.FindCarID(label10.Text);

                                //statename = GetEditionState.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                                //if (statename != "")
                                //{
                                //    char[] spldata = { ',' };
                                //    string[] msplit = statename.Split(spldata);

                                //     stName = msplit[0].ToString();

                                //    stName = stName + " ".ToString();

                                // stcde = msplit[1].ToString();

                                GeneralFunction.LinkInvoke(webBrowser1, stName1);

                                //  GeneralFunction.LinkInvokestate(webBrowser1, stName1);
                            }

                        }

                        if (stName.Contains(" "))
                        {
                            stName = stName.Replace(" ", "_");
                        }
                        //if (stName == "New Jersey")
                        //{
                        //    stName = "New_Jersey";
                        //}
                        //else if (stName == "West Virginia")
                        //{
                        //    stName = "West_Virginia";
                        //}
                        string gh = "http://www.classifiededition.com/" + stcde + "_" + stName + "/";
                        if (webBrowser1.Url.ToString() == "http://www.classifiededition.com/" + stcde + "_" + stName + "/")
                        {

                            // {http://www.classifiededition.com/108_Pennsylvania/
                            GeneralFunction.LinkInvoke(webBrowser1, "Unlimited Free Post");

                        }

                        if (webBrowser1.Url.ToString() == "http://www.classifiededition.com/index.php?view=post&cityid=" + stcde + "&lang=en&funcountry=" + stcde)
                        {

                            GeneralFunction.LinkInvoke(webBrowser1, "Vehicles");
                        }
                        if (webBrowser1.Url.ToString() == "http://www.classifiededition.com/?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3")
                        {

                            int year = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                            if (rb_Trucks.Checked)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Trucks");
                            }
                            else
                            {
                                if (year < 1991)
                                {
                                    GeneralFunction.LinkInvoke(webBrowser1, "Classic Cars");
                                }
                                else
                                {
                                    GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                                }
                            }
                            circularProgressControl2.Stop();
                            panel2.Visible = false;
                            circularProgressControl2.Visible = false;
                        }
                        if ((webBrowser1.Url.ToString() == "http://www.classifiededition.com/?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=50")
                         || (webBrowser1.Url.ToString() == "http://www.classifiededition.com/?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=55")
                         || (webBrowser1.Url.ToString() == "http://www.classifiededition.com/?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=51"))
                        {
                            //if ((clsfd == 0) || (clsfd == 1))
                            //{

                            if ((clsfd == 0))
                            {
                                IWebSites objClass = new ClassifiedEditor();
                                objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                                clsfd++;
                                btnpostsubmit.Visible = true;
                                btnpostsubmit.Enabled = true;
                            }
                       }

                        if ((webBrowser1.Url.ToString() == "http://www.classifiededition.com/index.php?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=50&")
                         || (webBrowser1.Url.ToString() == "http://www.classifiededition.com/index.php?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=55&")
                         || (webBrowser1.Url.ToString() == "http://www.classifiededition.com/index.php?view=post&cityid=" + stcde + "&funcountry=" + stcde + "&lang=en&catid=3&subcatid=51&"))
                        {

                            foreach (HtmlElement htmlElement in webBrowser1.Document.Links)
                            {
                                string InnerTxt = "Back to Home";
                                if (htmlElement.InnerText == InnerTxt)
                                {
                                    if (edi == 0)
                                    {
                                        edi++;
                                        label31.Font = new System.Drawing.Font("Verdana", 8.0f,
                                        System.Drawing.FontStyle.Bold);
                                        label31.ForeColor = System.Drawing.Color.Red;
                                        btnpostsubmit.Enabled = false;
                                        btnuploadtolive.Visible = true;
                                        btnuploadtolive.Enabled = true;
                                    }
                                }
                            }
                            if (edi == 0)
                            {
                                edi++;
                                MessageBox.Show("Enter Security Code and Check All the fields ", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                GeneralFunction.CheckedInvoke(webBrowser1, "agree");
                            }
                        }
                    }
                    #endregion
                }

                //postfreeadshere.com start-----------------------
                if (comboBox1.Text == "www.postfreeadshere.com")
                {
                    #region www.postfreeadshere.com
                    if (webBrowser1.Url.ToString() == "http://www.postfreeadshere.com/publish-a-new-ad.htm")
                    {
                        if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            btnpostupload.Enabled = true;
                            btnpostupload.Visible = true;

                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }
                    }
                    if (webBrowser1.Url.ToString() != "http://www.postfreeadshere.com/publish-a-new-ad.htm")
                    {
                        foreach (HtmlElement htmlElement in webBrowser1.Document.Links)
                        {
                            string InnerTxt = "No Thanks! - I am ok with the FREE POSTING..";
                            if (htmlElement.InnerText == InnerTxt)
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,
                                System.Drawing.FontStyle.Bold);
                                label29.ForeColor = System.Drawing.Color.Red;
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;
                            }
                        }
                    }
                    #endregion
                }
                //postfreeadshere.com end-----------------------

                //cathaylist start-------------------------
                if (comboBox1.Text == "cathaylist")
                {
                    #region cathaylist
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.cathaylist.com/?view=selectcity&targetview=post&cityid=0&lang=en")
                        {
                            cthy = 0;
                            btnpostupload.Visible = true;
                            btnpostupload.Enabled = false;

                            this.Opacity = 100;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            this.Refresh();
                        }

                        if (webBrowser1.Url.ToString() != "http://www.cathaylist.com/?view=selectcity&targetview=post&cityid=0&lang=en")
                        {
                            if (cthy == 0)
                            {
                                url = webBrowser1.Url.ToString();
                                if (url.Contains("cityid="))
                                {

                                    int index1 = url.IndexOf("cityid=");
                                    int end1 = url.IndexOf("lang=");
                                    url = url.ToString().Substring(index1, end1 - index1);
                                    url = url.Replace("cityid=", "");
                                    url = url.Replace("&", "");
                                    label27.Font = new System.Drawing.Font("Verdana", 8.0f,
                                    System.Drawing.FontStyle.Bold);

                                    circularProgressControl2.Start();
                                    panel2.Visible = true;
                                    circularProgressControl2.Visible = true;
                                }
                                cthy++;
                            }
                        }
                        //  string fsg = "http://www.cathaylist.com/?view=post&postevent=&cityid=" + url + "&lang=en&catid=&subcatid=";

                        if (webBrowser1.Url.ToString() == "http://www.cathaylist.com/?view=post&postevent=&cityid=" + url + "&lang=en&catid=&subcatid=")
                        {
                            webBrowser1.Navigate("http://www.cathaylist.com/?view=post&cityid=" + url + "&lang=en&catid=2&subcatid=6&shortcutregion=");
                        }

                        if (webBrowser1.Url.ToString() == "http://www.cathaylist.com/?view=post&cityid=" + url + "&lang=en&catid=2&subcatid=6&shortcutregion=")
                        {
                            Globaltxtemail.txtemail = comboBox2.Text;
                            circularProgressControl2.Stop();
                            panel2.Visible = false;
                            circularProgressControl2.Visible = false;

                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new cathaylist();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                            btnpostsubmit.Enabled = true;
                            btnpostsubmit.Visible = true;

                        }
                        string gfg = "http://www.cathaylist.com/index.php?view=post&cityid=" + url + "&lang=en&catid=2&subcatid=6&shortcutregion=&";
                        if (webBrowser1.Url.ToString() == "http://www.cathaylist.com/index.php?view=post&cityid=" + url + "&lang=en&catid=2&subcatid=6&shortcutregion=&")
                        {

                            foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                string InnerTxt = "Back to Home";
                                if (element.OuterText == InnerTxt)
                                {
                                    label29.Font = new System.Drawing.Font("Verdana", 8.0f,
               System.Drawing.FontStyle.Bold);
                                    btnpostsubmit.Enabled = false;
                                    btnuploadtolive.Visible = true;
                                    btnuploadtolive.Enabled = true;
                                }
                            }

                        }

                    }
                    #endregion
                }
                //cathaylist end-------------------------
                if (comboBox1.Text == "www.freeadlists.com")
                {
                    #region www.freeadlists.com
                    btnpostupload.Visible = true;
                    btnpostupload.Enabled = true;

                    this.Opacity = 100;
                    circularProgressControl2.Stop();
                    circularProgressControl2.Visible = false;
                    panel2.Visible = false;
                    this.Refresh();
                    #endregion
                }

                if (comboBox1.Text == "adsriver")
                {
                    #region adsriver
                    //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //int year=obUsedCarsInfo[0].YearOfMake;
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    if (webBrowser1.Url.ToString() == "http://www.adsriver.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                        //btnpostupload.Visible = true;
                        //btnpostupload.Enabled = true;

                    }
                    if (webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=selectcity&targetview=post&cityid=0&lang=en")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "USA");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=post&postevent=&cityid=1&lang=en&catid=&subcatid=" || webBrowser1.Url.ToString() == "http://www.adsriver.com/index.php?view=post&cityid=1&lang=en")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Automotive");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&shortcutregion=")
                    {
                        if (rb_Trucks.Checked || rb_Vans.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Vans & Trucks ");
                        }
                        else
                        {
                            if (Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString()) > 1991)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                            }
                            else
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Other");
                            }
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=13&shortcutregion="
                     || webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=6&shortcutregion="
                     || webBrowser1.Url.ToString() == "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=16&shortcutregion=")
                    {

                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new Adsriver();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                    }
                    if (webBrowser1.Url.ToString() != "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=13&shortcutregion="
                     || webBrowser1.Url.ToString() != "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=16&shortcutregion="
                     || webBrowser1.Url.ToString() != "http://www.adsriver.com/?view=post&cityid=1&lang=en&catid=1&subcatid=6&shortcutregion=")
                    {
                        //btnpostsubmit.Enabled = false;
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "Back to Home";
                            if (element.OuterText == InnerTxt)
                            {
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                                btnpostsubmit.Visible = false;
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;
                            }
                        }
                    }
                    #endregion
                }

                if (comboBox1.Text == "anunico")
                {
                    #region anunico
                    string anuurl = string.Empty;
                    // http://www.anunico.us/post_free_ads_buying_selling_cars_real_estate_jobs.html
                    if (webBrowser1.Url.ToString() == "http://www.anunico.us/post_free_ads_in_united_states.html")
                    {
                        btnpostupload.Visible = true;
                        btnpostupload.Enabled = true;

                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                    }

                    if (webBrowser1.Url.ToString() != "http://www.anunico.us/post_free_ads_in_united_states.html")
                    {
                        string url = webBrowser1.Url.ToString();

                        if (url.Contains("cityid="))
                        {

                            int index1 = url.IndexOf("cityid=");
                            int end1 = url.IndexOf("lang=");
                            anuurl = url.ToString().Substring(index1, end1 - index1);
                            anuurl = anuurl.Replace("cityid=", "");
                            anuurl = anuurl.Replace("&", "");
                        }
                    }
                    string nhh = "http://www.anunico.es/?view=post&cityid=" + anuurl + "&lang=en.us";
                    if (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Vehicles");
                    }

                    if (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8")
                    {

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        int yearnw = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                        if (rb_Vans.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Pickups - Vans");
                        }
                        else if (rb_Trucks.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Trucks");
                        }
                        else
                        {
                            if (yearnw < 1991)
                            {

                                GeneralFunction.LinkInvoke(webBrowser1, "Collectible - Classic Cars");

                            }
                            else
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                            }
                        }
                    }
                    if ((webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=36")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=37")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=42")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=40"))
                    {
                        btnpostsubmit.Visible = false;
                        btnpostsubmit.Enabled = false;

                        circularProgressControl2.Stop();
                        panel2.Visible = false;
                        circularProgressControl2.Visible = false;

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new anunico();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        if (anupic == 0)
                        {
                            anupic++;
                        }
                    }
                    if ((webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=36&adid=&page=&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=36&adid=0&page=0&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=37&adid=&page=&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=37&adid=0&page=0&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=42&adid=&page=&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=42&adid=0&page=0&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=40&adid=&page=&search=&cityname=&")
                     || (webBrowser1.Url.ToString() == "http://www.anunico.us/?view=post&cityid=" + anuurl + "&lang=en.us&catid=8&subcatid=40&adid=0&page=0&search=&cityname=&"))
                    {

                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                            {
                                string InnerTxt = "Back to Home";
                                if (element.OuterText == InnerTxt)
                                {
                                    label29.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                                    ano++;
                                    btnpostsubmit.Enabled = false;
                                    btnuploadtolive.Visible = true;
                                    btnuploadtolive.Enabled = true;

                                }
                                else
                                {

                                }
                            }
                        }

                        if (ano == 1)
                        {
                        }
                        else
                        {
                            if (ano == 0)
                            {
                                MessageBox.Show("Mandatory fields should not leave empty");
                                GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                                btnpostsubmit.Enabled = true;
                                ano++;
                            }

                        }
                    }
                    #endregion
                }
                if (comboBox1.Text == "classifieds4me")
                {
                    #region classifieds4me
                    string clsurl = string.Empty;
                    if (webBrowser1.Url.ToString() != "http://www.classifieds4me.com/postad/category.aspx")
                    {
                        if (webBrowser1.Url.ToString() != "http://www.classifieds4me.com/select-city.aspx")
                        {
                            string url = webBrowser1.Url.ToString();
                            if (url.Contains("city="))
                            {
                            }
                            else
                            {
                                if (c4mcty == 0)
                                {

                                    circularProgressControl2.Stop();
                                    circularProgressControl2.Visible = false;
                                    panel2.Visible = false;
                                    GeneralFunction.LinkInvoke(webBrowser1, "Select City");

                                    c4mcty++;
                                }
                            }
                        }
                    }

                    if (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/select-city.aspx")
                    {

                        //if (c4cy == 0)
                        //{
                        //    c4cy++;

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        GeneralFunction.SetDropDownNameandValue(webBrowser1, "ctl00$ContentPlaceHolder1$cboCountry", "124");
                        string state = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                        GeneralFunction.SetDropDownName(webBrowser1, "ctl00$ContentPlaceHolder1$cboState", state);

                        btnpostupload.Visible = true;
                        btnpostupload.Enabled = true;
                        // }

                    }

                    // http://www.classifieds4me.com/rochester-classified-ads-T12961/

                    //string suburl = webBrowser1.Url.ToString();
                    //if (suburl.Contains("-classified-ads-"))
                    //{
                    //    if (pfc != 0)
                    //    {

                    //        string split = suburl.ToString();
                    //        int index1 = split.IndexOf(".com/");
                    //        int end1 = split.IndexOf("-classified");
                    //        string c4mCity = split.ToString().Substring(index1, end1 - index1);
                    //        c4mCity = c4mCity.Replace(".com/", "");

                    //        string split1 = suburl.ToString();
                    //        int index2 = split1.IndexOf("ads-");
                    //        int end2 = split.Length;
                    //        string c4mCityId = split.ToString().Substring(index2, end2 - index2);
                    //        c4mCityId = c4mCityId.Replace("/", "");
                    //        c4mCityId = c4mCityId.Replace("ads-", "");

                    //        if (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/" + c4mCity + "-classified-ads-" + c4mCityId + "/")
                    //        {
                    //            GeneralFunction.LinkInvoke(webBrowser1, "Post a FREE Classified Ad");

                    //        }

                    //    }

                    //}

                    string suburl = webBrowser1.Url.ToString();
                    if (suburl.Contains("-classified-ads-"))
                    {

                        //{http://www.classifieds4me.com/west-haven-classified-ads-T9336/}

                        //    int index1 = url.IndexOf(".com/");
                        //    int end1 = url.IndexOf("classified");
                        //   string clsurl1 = url.ToString().Substring(index1, end1 - index1);
                        //    clsurl1 = clsurl1.Replace(".com/", "");
                        //    clsurl1 = clsurl1.Replace("classified", "");

                        // int index2 = url.IndexOf("ads-");
                        //    int end2 = url.Length;;
                        //   string code = url.ToString().Substring(index2, end2 - index2);
                        //    code = code.Replace("ads-", "");
                        //    code = code.Replace("/", "");

                        //if(webBrowser1.Url.ToString()=="http://www.classifieds4me.com/"+clsurl1+"-classified-ads-"+code+"/")
                        //{
                        //}

                        //btnpostupload.Visible = true;
                        //btnpostupload.Enabled = true;

                        //GeneralFunction.SetDropDownName(webBrowser1, "ctl00$ContentPlaceHolder1$cboCountry", "United States");

                        //GeneralFunction.SetDropDownNameandValue(webBrowser1, "ctl00$ContentPlaceHolder1$cboState", "525");
                    }

                    if (webBrowser1.Url.ToString() != "http://www.classifieds4me.com/postad/category.aspx")
                    {
                        string url = webBrowser1.Url.ToString();

                        if (url.Contains("city="))
                        {

                            int index1 = url.IndexOf("city=");
                            int end1 = url.IndexOf("&");
                            clsurl = url.ToString().Substring(index1, end1 - index1);
                            clsurl = clsurl.Replace("city=", "");
                            clsurl = clsurl.Replace("&", "");
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/postad/category.aspx")
                    {
                        circularProgressControl2.Start();
                        circularProgressControl2.Visible = true;
                        panel2.Visible = true;

                        btnpostupload.Enabled = false;
                        GeneralFunction.LinkInvoke(webBrowser1, "Autos");
                    }

                    if (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/postad/subcategory.aspx?city=" + clsurl + "&CatId=Autos")
                    {

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        int yr = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                        if (yr < 1991 || rb_Trucks.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Other: Autos For Sale");
                        }
                        else
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Cars & SUVs");
                        }
                        btnpostupload.Enabled = false;
                    }
                    if ((webBrowser1.Url.ToString() == "http://www.classifieds4me.com/postad/post-ad.aspx?city=" + clsurl + "&cat=Autos&subcat=Cars_SUV") || (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/postad/post-ad.aspx?city=" + clsurl + "&cat=Autos&subcat=Other_Autos"))
                    {

                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        if (cls4me == 0)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new classifieds4me();

                            cls4me++;

                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;

                            label28.Font = new System.Drawing.Font("Verdana", 8.0f,
               System.Drawing.FontStyle.Bold);
                            label28.ForeColor = System.Drawing.Color.Red;
                        }

                    }
                    string url1 = webBrowser1.Url.ToString();
                    if (url1.ToString().Contains("post-ad-success"))
                    {
                        btnpostsubmit.Enabled = false;
                        btnuploadtolive.Visible = true;
                        btnuploadtolive.Enabled = true;
                        label31.Font = new System.Drawing.Font("Verdana", 8.0f,
               System.Drawing.FontStyle.Bold);

                        label31.ForeColor = System.Drawing.Color.Red;

                    }

                    else
                    {

                        //GeneralFunction.FileUploadInvoke(webBrowser1, "ctl00$ContentPlaceHolder1$FileUpload1");
                        //GeneralFunction.FileUploadInvoke(webBrowser1, "ctl00$ContentPlaceHolder1$FileUpload2");
                        //GeneralFunction.FileUploadInvoke(webBrowser1, "ctl00$ContentPlaceHolder1$FileUpload3");
                    }
                    // http://www.classifieds4me.com/postad/post-ad-success.aspx?id=967539
                    #endregion
                }

                if (comboBox1.Text == "myadmonster")
                {
                    #region myadmonster
                    if (webBrowser1.Url.ToString() == "http://www.myadmonster.com/free-ads/postfreead.php")
                    {

                        btnpostupload.Visible = true;
                        btnpostupload.Enabled = true;
                        GeneralFunction.ImgeButtonClickInvoke(webBrowser1, "Click Here To Post A Free Classified Ad");
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                    }
                    if (webBrowser1.Url.ToString() == "http://www.myadmonster.com/free-ads/post_b.php")
                    {

                        if (myads == 0)
                        {
                            GeneralFunction.SetDropDownNameandValue(webBrowser1, "sel_intl_country", "United States");

                            GeneralFunction.SetDropDownNameandValue(webBrowser1, "sel_cat", "Automotive");
                            GeneralFunction.SetDropDownNameandValue(webBrowser1, "sel_duration", "28");

                            GeneralFunction.ButtonClickInvokeValue(webBrowser1, " Continue ");

                            label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);

                            label27.ForeColor = System.Drawing.Color.Red;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;

                            btnpostupload.Enabled = false;

                            myads++;
                        }
                        // MessageBox.Show("Please select Continue button");

                    }

                    if (webBrowser1.Url.ToString() == "http://www.myadmonster.com/free-ads/post_c.php")
                    {

                        if (repeat == 0)
                        {
                            //repeat += 1;
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            IWebSites objClass = new myadmonster();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                        }
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                        btnpostupload.Enabled = false;

                    }

                    if (webBrowser1.Url.ToString() != "http://www.myadmonster.com/free-ads/postfreead.php")
                    {
                        if (webBrowser1.Url.ToString() != "http://www.myadmonster.com/free-ads/post_b.php")
                        {
                            if (webBrowser1.Url.ToString() != "http://www.myadmonster.com/free-ads/post_c.php")
                            {
                                ////          foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                                ////{
                                // string InnerTxt = "Cars";
                                ////if (element.OuterHtml == "Click here to view your ad")
                                ////{
                                label29.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                                label29.ForeColor = System.Drawing.Color.Red;
                                btnpostsubmit.Enabled = false;
                                btnuploadtolive.Visible = true;
                                btnuploadtolive.Enabled = true;
                            }
                            // }
                            //  }
                        }
                    }
                    #endregion
                }

                if (comboBox1.Text == "freead1.net")
                {
                    #region freead1.net
                    if (webBrowser1.Url.ToString() == "http://freead1.net/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "POST FREE AD USA");
                    }
                    if (webBrowser1.Url.ToString() == "http://freead1.net/post-free-ad-to-USA-42")
                    {

                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;

                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        if (fread == 0)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new freead1();

                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            fread++;
                        }
                    }

                    string url = webBrowser1.Url.ToString();
                    if (url.Contains("add-success"))
                    {
                        btnpostsubmit.Enabled = false;
                        btnuploadtolive.Visible = true;
                        btnuploadtolive.Enabled = true;
                    }
                    #endregion
                }
                #region old
                //if (comboBox1.Text == "classifiedads")
                //{
                //    if (webBrowser1.Url.ToString() == "http://www.classifiedads.com/post.php")
                //    {
                //        btnpostupload.Visible = true;
                //        btnpostupload.Enabled = true;
                //    }

                //    else if (webBrowser1.Url.ToString() == "http://www.classifiedads.com/post.php")
                //    {
                //        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                //        {
                //            string InnerTxt = "Cars";
                //            if (element.OuterText == InnerTxt)
                //            {
                //                //United States
                //               // GeneralFunction.LinkInvoke(webBrowser1, "Vehicles");
                //                GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                //                //  GeneralFunction.LinkInvoke(webBrowser1, "United States");
                //            }
                //        }
                //    }

                //    else if (webBrowser1.Url.ToString() == "http://www.classifiedads.com/post.php")
                //    {
                //        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                //        {
                //            string InnerTxt = "United States";
                //            if (element.OuterText == InnerTxt)
                //            {
                //                //United States
                //                // GeneralFunction.LinkInvoke(webBrowser1, "Vehicles");
                //               // GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                //                  GeneralFunction.LinkInvoke(webBrowser1, "United States");
                //            }
                //        }
                //    }

                //}
                #endregion
                if (comboBox1.Text == "99localsearch")
                {
                    #region 99localsearch
                    if (webBrowser1.Url.ToString() == "http://www.99localsearch.com/freeclassified.aspx")
                    {

                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        btnpostupload.Visible = true;
                        btnpostupload.Enabled = true;

                    }
                    #endregion
                }
                if (comboBox1.Text == "classifiedads")
                {
                    #region classifiedads
                    if (webBrowser1.Url.ToString() == "http://www.classifiedads.com/")
                    {

                        GeneralFunction.LinkInvokeClsads(webBrowser1, "Post an Ad (free)", "Post an ad (free)");

                    }
                    if (webBrowser1.Url.ToString() == "http://www.classifiedads.com/post.php")
                    {
                        if (cads == 0)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            //btnpostupload.Visible = true;
                            //btnpostupload.Enabled = true;
                            //btnpostsubmit.Visible = true;
                            //btnpostsubmit.Enabled = true;
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            IWebSites objClass = new ClassifiedAdds();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            cads++;
                        }
                        if (cads == 1)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new ClassifiedAdds();

                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            cads++;
                        }
                        if (cads == 2)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new ClassifiedAdds();

                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            cads++;
                        }
                        if (cads == 3)
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);

                            IWebSites objClass = new ClassifiedAdds();

                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                            GeneralFunction.FileUploadInvoke(webBrowser1, "uploadedfile");
                            //GeneralFunction.FileUploadInvoke(webBrowser1, "uploadedfile");
                            //GeneralFunction.FileUploadInvoke(webBrowser1, "uploadedfile");
                            cads++;

                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;
                        }
                        //if (cads == 4)
                        //{
                        //    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();

                        //    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        //    obUsedCarsInfo = objService.FindCarID(label10.Text);

                        //    IWebSites objClass = new ClassifiedAdds();

                        //    objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                        //    cads++;
                        //}

                    }
                    if (webBrowser1.Url.ToString() != "http://www.classifiedads.com/post.php")
                    {
                        string urltst = webBrowser1.Url.ToString();

                        if (urltst.Contains(".htm"))
                        {
                            label29.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                            label29.ForeColor = System.Drawing.Color.Red;
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                            btnpostsubmit.Enabled = false;

                        }
                    }
                    #endregion
                }
                if (comboBox1.Text == "facebook")
                {
                    #region facebook
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/login.php?next=https://www.facebook.com/messages/")
                    {
                        btnpostupload.Enabled = true;
                        btnpostupload.Visible = true;

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new FaceBook();

                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    // if (webBrowser1.Url.ToString() == "https://www.facebook.com/messages/")
                    //{
                    //    GeneralFunction.LinkInvoke(webBrowser1, "Home");
                    // }
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/messages/")
                    {
                        GeneralFunction.LinkInvokeDiv(webBrowser1, "menuPulldown", "Account Settings");
                        GeneralFunction.LinkInvokeDiv(webBrowser1, "navSubmenuName ellipsis", "UCE - Test");
                    }
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/pages/UCE-Test/637729332928509?ref=hl")
                    {
                        //   GeneralFunction.ImgeButtonClickFB(webBrowser1);
                    }
                    //if (webBrowser1.Url.ToString() == "https://www.facebook.com/?ref=tn_tnmn")
                    //{
                    //    GeneralFunction.LinkInvokeDiv(webBrowser1, "linkWrap noCount", "United Car Exchange");
                    //}
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/pages/United-Car-Exchange/321065371264090")
                    {
                        GeneralFunction.LinkInvokeFB(webBrowser1, "uiIconText _51z7");
                    }
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/pages/United-Car-Exchange/321065371264090")
                    {
                        GeneralFunction.LinkInvokeFBInnerDiv(webBrowser1, "Create Photo Album");
                    }
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/pages/United-Car-Exchange/321065371264090#!/albums/create.php?id=321065371264090&error=3")
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        string title = obUsedCarsInfo[0].YearOfMake.ToString() + " " + obUsedCarsInfo[0].Make.ToString() + " " + obUsedCarsInfo[0].Model.ToString();
                        GeneralFunction.SetTextvaluebyName(webBrowser1, "name", title);
                        string location = obUsedCarsInfo[0].State.ToString() + " " + obUsedCarsInfo[0].City.ToString() + " " + obUsedCarsInfo[0].Zip.ToString();
                        GeneralFunction.SetTextvaluebyName(webBrowser1, "location", location);
                        GeneralFunction.ButtonClickBody(webBrowser1, "button");
                    }
                    if (webBrowser1.Url.ToString() == "https://www.facebook.com/pages/United-Car-Exchange/321065371264090?id=321065371264090&sk=photos_stream")
                    {

                        GeneralFunction.LinkInvokeFB(webBrowser1, "fbPhotosRedesignNavSubtitle");

                    }

                    //if (webBrowser1.Url.ToString() == "https://www.facebook.com/media/set/edit/a.581830711854220.1073743406.321065371264090/")
                    //{
                    //https://www.facebook.com/media/upload/photos/simple/?set=a.582546955115929.1073743487.321065371264090

                    string sburl = webBrowser1.Url.ToString();
                    if (sburl.Contains("set"))
                    {
                        // foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("input"))
                        //{
                        string InnerTxt = "Add Date";
                        //    if (element.OuterText == InnerTxt)
                        //  {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        //IWebSites objClass = new FaceBook();

                        //objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);

                        string title = obUsedCarsInfo[0].YearOfMake.ToString() + " " + obUsedCarsInfo[0].Make.ToString() + " " + obUsedCarsInfo[0].Model.ToString();
                        string dep = obUsedCarsInfo[0].Description.ToString();
                        GeneralFunction.SetDivValuebyInnerText(webBrowser1, "inputtext _5eln photoAlbumTitleInput DOMControl_placeholder", title);
                        string location = obUsedCarsInfo[0].State.ToString() + " " + obUsedCarsInfo[0].City.ToString() + " " + obUsedCarsInfo[0].Zip.ToString();
                        GeneralFunction.SetTextvaluebyName(webBrowser1, "location", location);

                        GeneralFunction.SetMultiTextName(webBrowser1, "desc_text", dep);

                        //GeneralFunction.ButtonClickBody(webBrowser1, "button");

                        // }
                        // }
                    }
                    #endregion
                }
                if (comboBox1.Text == "pinterest")
                {
                    #region pinterest
                    if (webBrowser1.Url.ToString() == "https://www.pinterest.com/")
                    {
                        foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("a"))
                        {
                            string InnerTxt = "Log in now";
                            if (element.OuterText == InnerTxt)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Log in now");
                            }
                        }
                    }
                    else if (webBrowser1.Url.ToString() == "https://www.pinterest.com/login/")
                    {

                        GeneralFunction.SetTextValue(webBrowser1, "username_or_email", "*****@*****.**");
                        GeneralFunction.SetTextValue(webBrowser1, "password", "vinayy12345");

                        GeneralFunction.LinkInvokeFB(webBrowser1, "buttonText");//epage
                    }

                    else if (webBrowser1.Url.ToString() == "http://www.pinterest.com/")
                    {

                        GeneralFunction.LinkInvokeFB(webBrowser1, "profileName");//epage

                        //GeneralFunction.LinkInvoke(webBrowser1, "                                            Your Boards");

                        GeneralFunction.Linkhref(webBrowser1, "/vinayy5544/boards/");

                        // GeneralFunction.LinkInvokeCollectorCarsPic(webBrowser1);

                        webBrowser1.Navigate("http://www.pinterest.com/vinayy5544/boards/");
                    }

                    ////
                    ////MODIFIED
                    ////

                    else if (webBrowser1.Url.ToString() == "http://www.pinterest.com/vinayy5544/boards/" || webBrowser1.Url.ToString() == "http://www.pinterest.com/vinayy5544/boards/#")
                    {

                        if (pnt == 0)
                        {
                            // GeneralFunction.LinkInvoke(webBrowser1, "Create a board");
                            // GeneralFunction.LinkInvokeCollectorCarsPic(webBrowser1);

                            GeneralFunction.LinkInvokepintrest(webBrowser1, "BoardCreateRep Module");
                            btnpostupload.Visible = true;
                            btnpostupload.Enabled = true;
                            circularProgressControl2.Stop();
                            circularProgressControl2.Visible = false;
                            panel2.Visible = false;
                            pnt++;
                        }
                    }
                    //        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //        obUsedCarsInfo = objService.FindCarID(label10.Text);

                    //        IWebSites objClass = new Pintrest();

                    //        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    //        circularProgressControl2.Stop();
                    //        circularProgressControl2.Visible = false;
                    //        panel2.Visible = false;
                    //    }

                    //}

                    #endregion
                }
                if (comboBox1.Text == "hot9ads")
                {
                    #region hot9ads
                    if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/")
                    {
                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();

                        GeneralFunction.LinkInvoke(webBrowser1, "Register for a free account");
                    }

                    if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/user/register")
                    {
                        //webBrowser1.Navigate("http://www.hot9ads.com/");

                        GeneralFunction.SetTextValue(webBrowser1, "s_email", comboBox2.Text);
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new Hot9Ads();

                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        ht9++;

                    }

                    if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/")
                    {
                        if (ht9 == 1)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Publish your ad for free");
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/item/new")
                    {

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new Hot9Ads();

                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                    }

                    if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/index.php")
                    {
                        //  GeneralFunction.LinkInvoke(webBrowser1, "Login");

                        MessageBox.Show("You have already registerd with this emailid.Change the emailid and post again");

                    }
                    //if (webBrowser1.Url.ToString() == "http://www.hot9ads.com/user/login")
                    //{
                    //    GeneralFunction.SetTextValue(webBrowser1, "s_email", comboBox2.Text);
                    //    GeneralFunction.SetTextValue(webBrowser1, "s_password", "UCEURV123");
                    //    GeneralFunction.ButtonClickBody(webBrowser1, "submit");
                    //}
                    #endregion
                }
                if (comboBox1.Text == "75vn")
                {
                    #region 75vn
                    if (webBrowser1.Url.ToString() == "http://www.75vn.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Login");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.75vn.com/member/login.php")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Create seller account (Free)");
                    }

                    if (webBrowser1.Url.ToString() == "http://www.75vn.com/member/create.php")
                    {
                        Globaltxtemail.txtemail = comboBox2.Text;
                        Globalpwd.pwd = textBox2.Text;

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new Vn75();

                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();
                    }

                    if (webBrowser1.Url.ToString() == "http://www.75vn.com/mod.php")
                    {

                        this.Opacity = 100;
                        circularProgressControl2.Start();
                        circularProgressControl2.Visible = true;
                        panel2.Visible = true;
                        this.Refresh();
                        GeneralFunction.LinkInvoke(webBrowser1, "Place an ad");

                    }
                    if (webBrowser1.Url.ToString() == "http://www.75vn.com/post.php")
                    {

                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        int year = Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString());
                        if (rb_Trucks.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "SELL YOUR COMMERCIAL TRUCK - Click Here");
                        }
                        else
                        {
                            if (year < 1990)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "SELL YOUR CLASSIC CAR - Click Here");
                            }
                            else
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "SELL YOUR CAR - Click Here");
                            }
                        }
                    }
                    if ((webBrowser1.Url.ToString() == "http://www.75vn.com/auto/place_ad.php?TypeItem=35") || (webBrowser1.Url.ToString() == "http://www.75vn.com/car/place_ad.php?TypeItem=32") || (webBrowser1.Url.ToString() == "http://www.75vn.com/truck/place_ad.php?TypeItem=31"))
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);

                        IWebSites objClass = new Vn75();

                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        GeneralFunction.ButtonClickInvoke(webBrowser1, "btn_Add");

                    }

                    if (webBrowser1.Url.ToString().Contains("&IDProduct="))
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "UPLOAD PHOTOS");

                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();

                    }

                    if (webBrowser1.Url.ToString().Contains("http://www.75vn.com/auto/") || webBrowser1.Url.ToString().Contains("http://www.75vn.com/truck/") || webBrowser1.Url.ToString().Contains("http://www.75vn.com/car/"))
                    {
                        if (webBrowser1.Url.ToString().Contains("IDProduct="))
                        {

                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                            //Log Out  http://www.75vn.com/car/display_ad.php?TypeItem=32&IDProduct=40649

                        }
                    }
                    #endregion
                }

                if (comboBox1.Text == "adpost us")
                {
                    #region adpost us
                    if (webBrowser1.Url.ToString() == "http://www.adpost.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "United States");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adpost.com/us/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adpost.com/us/?website=&language=&session_key=&place_front_page=on")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Vehicles");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adpost.com/us/?db=us_vehicles&website=&language=&session_key=&add_item_button=on")
                    {
                        //GeneralFunction.LinkInvoke(webBrowser1, "Click here to Register now!");
                        GeneralFunction.SetTextValue(webBrowser1, "auth_user_name", "IL54545");
                        GeneralFunction.SetTextValue(webBrowser1, "auth_password1", Globalpwd.pwd);
                    }
                    if ((webBrowser1.Url.ToString() ==
                        "http://www.adpost.com/us/?&db=us_vehicles&session_key=&add_item_button=on&language=&website=&auth_register_screen_op=on&")
                     || (webBrowser1.Url.ToString() ==
                     "http://www.adpost.com/us/?&add_item_button=on&website=&db=us_vehicles&session_key=&language=&auth_register_screen_op=on&"))
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new adpost_us();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        this.Opacity = 100;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = false;
                        this.Refresh();
                        btnpostupload.Enabled = true;
                        btnpostupload.Visible = true;
                        if (adp == 0)
                        {
                            adp++;
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://www.adpost.com/us/")
                    {
                        //if (adp == 1)
                        //{
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites objClass = new adpost_us();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        //}
                    }
                    #endregion
                }
                if (comboBox1.Text == "webcosmo")
                {
                    #region webcosmo

                    GeneralFunction.SetDropDownNameandValue(webBrowser1, "ctl00$cphContent$ddlCountry", "1");
                    GeneralFunction.SetDropDownNameandValue(webBrowser1, "ctl00$cphContent$ddlGenre", "4");
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    IWebSites objClass = new WebCosmo();
                    if (webBrowser1.Url.ToString().Contains("PostListing.aspx") && webBrowser1.Url.ToString().Contains("countryId=1&stateId="))
                    {
                        if (a)
                        {
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            a = false;
                            //GeneralFunction.ButtonClickInvoke(webBrowser1, "ctl00$cphContent$btnSubmit");

                        }
                        else if (webBrowser1.DocumentText.ToString().Contains("Duplicate posting"))
                        {
                            MessageBox.Show("Carid once posted in this site is not allowed to post again within 24 Hours");
                        }

                    }
                    else if (webBrowser1.Url.ToString().Contains("PostReview.aspx") && webBrowser1.Url.ToString().Contains("countryId=1&stateId=") || webBrowser1.Url.ToString().Contains("countryid=1&stateid="))
                    {
                        btnpostupload.Visible = false;
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                    }
                    circularProgressControl2.Stop();
                    btnpostupload.Visible = true;
                    btnpostupload.Enabled = true;

                    #endregion
                }
                if (comboBox1.Text == "tumblr")
                {
                    #region tumblr

                    if (webBrowser1.Url.ToString() == "https://www.tumblr.com/login?redirect_to=%2Fnew%2Ftext")
                    {
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "user[email]");
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "user[password]");
                    }
                    else if (webBrowser1.Url.ToString() == "http://www.tumblr.com/dashboard")
                    {
                        GeneralFunction.LinkhrefForTumbler(webBrowser1, "new_post_label_text");

                    }
                    else if (webBrowser1.Url.ToString() == "http://www.tumblr.com/new/text?redirect_to=/dashboard"
                          || webBrowser1.Url.ToString() == "http://www.tumblr.com/new/text")
                    {

                        //Add car Details Title,Description
                        GeneralFunction.SetTextValue(webBrowser1, "post[one]", "Hello");
                        GeneralFunction.SetMultiTextValue(webBrowser1, "post[two]", "Hello Description");
                        //Should Add Images Manually
                        GeneralFunction.ButtonClick(webBrowser1, "submit");
                    }
                    #endregion
                }
                if (comboBox1.Text == "cargurus")
                {
                    #region cargurus

                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    IWebSites objClass = new WebCosmo();
                    string username = comboBox2.Text; ;
                    Char[] seprt = { '@' };
                    string[] splitemail = username.Split(seprt);
                    username = splitemail[0].ToString();
                    if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.cargurus.com/")
                        {
                            ucount++;
                            GeneralFunction.spanLinkInvoke(webBrowser1, "Register");
                        }
                        if (webBrowser1.Url.ToString() == "http://www.cargurus.com/")
                        {
                            if (ucount > 1)
                            {
                                foreach (HtmlElement element in webBrowser1.Document.GetElementsByTagName("span"))
                                {
                                    if (element.InnerText.Trim() == "Sell Your Car")
                                    {
                                        GeneralFunction.spanLinkInvoke1(webBrowser1, "Sell Your Car");
                                        ucount--;
                                        return;
                                    }
                                }
                            }
                        }
                        if (webBrowser1.Url.ToString() == "https://www.cargurus.com/Cars/authentication/renderRegistrationForm.action?redirectUrl=/Cars/index.html&cgLocale=en")
                        {
                            GeneralFunction.SetTextValue(webBrowser1, "person.screenName", username);
                            GeneralFunction.SetTextValue(webBrowser1, "person.password", textBox2.Text);
                            GeneralFunction.SetTextValue(webBrowser1, "person.email", comboBox2.Text);
                            GeneralFunction.ButtonClickInvokeInnerText1(webBrowser1, "Register");
                        }
                        if (webBrowser1.Url.ToString() == "http://www.cargurus.com/Cars/sell-car/")
                        {
                            GeneralFunction.SetTextValue(webBrowser1, "zip", obUsedCarsInfo[0].Zip.ToString());
                            GeneralFunction.ButtonClickInvokeInnerText1(webBrowser1, "Get Started");
                        }
                        if (webBrowser1.Url.ToString() == "http://www.cargurus.com/Cars/sell-car/createAd.action?zip=" + obUsedCarsInfo[0].Zip.ToString())
                        {
                            SelectOption(webBrowser1, obUsedCarsInfo[0].Make.ToString(), "ign-makerId-selectedEntity");
                            SelectOption(webBrowser1, obUsedCarsInfo[0].Model.ToString(), "ign-modelId-selectedEntity");
                            //SelectOption(webBrowser1, obUsedCarsInfo[0].YearOfMake.ToString(), "ign-carId-selectedEntity");
                            //SelectOption(webBrowser1, obUsedCarsInfo[0].Transmission.ToString(), "selectedTransmission");
                            //GeneralFunction.SetTextValue(webBrowser1, "exteriorColor", obUsedCarsInfo[0].ExteriorColor.ToString());
                            //GeneralFunction.SetTextValue(webBrowser1, "interiorColor", obUsedCarsInfo[0].InteriorColor.ToString());
                            //GeneralFunction.SetTextValue(webBrowser1, "vin", obUsedCarsInfo[0].VIN.ToString());
                            IWebSites ob = new cargurus();
                            ob.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);

                        }
                        if (webBrowser1.Url.ToString().Contains("addPhotos.action") && webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            ucount1++;
                        }
                        if (webBrowser1.Url.ToString().Contains("addPhotos.action") && webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                        {
                            if (ucount1 == 1)
                            {
                                //for (int i = 0; i < 3; i++)
                                //{
                                GeneralFunction.FileUploadInvoke(webBrowser1, "file");
                                GeneralFunction.FileUploadInvoke(webBrowser1, "file");
                                //GeneralFunction.FileUploadInvoke(webBrowser1, "file");
                                //}
                                ucount1++;
                                //GeneralFunction.ButtonClickByValue(webBrowser1, "Finish");
                                btnpostsubmit.Enabled = true;
                                btnpostsubmit.Visible = true;
                            }

                        }
                        if (webBrowser1.Url.ToString().Contains("viewGarage.action"))
                        {
                            btnpostsubmit.Visible = false;
                            btnpostsubmit.Enabled = false;
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                            //GeneralFunction.LinkInvoke(webBrowser1, "Sign out");
                            //circularProgressControl2.Stop();
                            //btnpostupload.Visible = true;
                            //btnpostupload.Enabled = true;
                        }

                    }
                    #endregion
                }
                if (comboBox1.Text == "soavo")
                {
                    #region soavo
                    if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://www.soavo.com/user/register")
                        {
                            string username = comboBox2.Text;
                            string mail = comboBox2.Text;
                            Char[] seprt = { '@' };
                            string[] splitemail = username.Split(seprt);
                            username = splitemail[0].ToString();
                            GeneralFunction.SetTextValue(webBrowser1, "s_name", username);
                            GeneralFunction.SetTextValue(webBrowser1, "s_password", "UCEURV123");
                            GeneralFunction.SetTextValue(webBrowser1, "s_password2", "UCEURV123");
                            GeneralFunction.SetTextValue(webBrowser1, "s_email", mail);
                            Txt_Url.Visible = true;
                            Navigate_btn.Visible = true;
                        }
                        if (webBrowser1.Url.ToString() == "http://www.soavo.com/")
                        {
                            Txt_Url.Visible = false;
                            Navigate_btn.Visible = false;
                            GeneralFunction.LinkInvoke(webBrowser1, "Publish your ad for free");
                        }
                        if (webBrowser1.Url.ToString() == "http://www.soavo.com/item/new")
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            IWebSites objClass = new soavo();
                            GeneralFunction.SetDropDownNameandValue(webBrowser1, "select_1", "100");
                            if (rb_Trucks.Checked || rb_Vans.Checked)
                            {
                                GeneralFunction.SetDropDownNameandValue(webBrowser1, "select_2", "143");
                            }
                            else if (Convert.ToInt32(obUsedCarsInfo[0].YearOfMake.ToString())<1991)
                            {
                                GeneralFunction.SetDropDownNameandValue(webBrowser1, "select_2", "144");
                            }
                            else
                            {
                                GeneralFunction.SetDropDownNameandValue(webBrowser1, "select_2", "140");
                            }
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            string statename = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), obUsedCarsInfo[0].Carid.ToString());
                            SelectOption(webBrowser1, statename, "regionId");
                            string city = obUsedCarsInfo[0].City.ToString();
                            SelectOption(webBrowser1, city, "cityId");
                            string cityarea = city + "," + obUsedCarsInfo[0].State.ToString() + obUsedCarsInfo[0].Zip.ToString();
                            GeneralFunction.SetTextValue(webBrowser1, "cityArea", cityarea);
                            GeneralFunction.SetTextValue(webBrowser1, "address", cityarea);
                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;
                        }
                        if (webBrowser1.Url.ToString() == "http://www.soavo.com/vehicles/cars")
                        {
                            btnpostsubmit.Visible = false;
                            btnpostsubmit.Enabled = false;
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                            GeneralFunction.LinkInvoke(webBrowser1, "Logout");
                        }

                    }
                    #endregion
                }
                if (comboBox1.Text == "web-free-ads" || comboBox1.Text == "webfreeads")
                {
                    #region webfreeads

                    if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/index.php?view=post&cityid=1&lang=en")
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Change");
                        }
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/?view=selectcity&targetview=post")
                        {
                            //string url = "";
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            string state = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State, "1");
                            GeneralFunction.LinkInvoke(webBrowser1, state);
                            foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("a"))
                            {
                                if (el.InnerText == state)
                                {
                                    url = el.GetAttribute("href").ToString();
                                    url = url.Substring(url.IndexOf("cityid"));
                                    url = url.Replace("cityid=", "");
                                    url = url.Substring(0, url.IndexOf("&"));
                                }
                            }

                        }
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/?view=post&postevent=&cityid="+url+"&lang=en&catid=&subcatid=")
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Automotive");
                        }
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/?view=post&cityid=" + url + "&lang=en&catid=8&shortcutregion=")
                        {
                            if(rb_Trucks.Checked || rb_Vans.Checked)
                                GeneralFunction.LinkInvoke(webBrowser1, "Vans & Commercial");
                            else
                                GeneralFunction.LinkInvoke(webBrowser1, "Cars");
                        }
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/?view=post&cityid=" + url + "&lang=en&catid=8&subcatid=3&shortcutregion="
                         || webBrowser1.Url.ToString() == "http://web-free-ads.com/?view=post&cityid=" + url + "&lang=en&catid=8&subcatid=9&shortcutregion=")
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            IWebSites obwebfreeads = new webfreeads();
                            obwebfreeads.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            GeneralFunction.SetTextValue(webBrowser1, "email", comboBox2.Text);
                            GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                            GeneralFunction.CheckedInvoke(webBrowser1, "agree");
                            //GeneralFunction.RadioSetValue(webBrowser1, "agree", "1");
                            btnpostsubmit.Visible = true;
                            btnpostsubmit.Enabled = true;
                        }
                        if (webBrowser1.Url.ToString() == "http://web-free-ads.com/index.php?view=post&cityid=" + url + "&lang=en&catid=8&subcatid=3&shortcutregion=&"
                         || webBrowser1.Url.ToString() == "http://web-free-ads.com/index.php?view=post&cityid=" + url + "&lang=en&catid=8&subcatid=9&shortcutregion=&")
                        {
                            btnpostsubmit.Visible = false;
                            btnpostsubmit.Enabled = false;
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                        }
                    }

                    #endregion
                }
                if (comboBox1.Text == "blackworld")
                {
                    #region blackworld
                    if (webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    }
                    if (webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/index.php?view=post&cityid=1&lang=en")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Auto Sales & Car Accessories");
                    }
                    if (webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/?view=post&cityid=1&lang=en&catid=4")
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        if (rb_Trucks.Checked)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Trucks & Heavy Vehicles");
                        }
                        else if (obUsedCarsInfo[0].Price < 2000)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Autos under $2000");
                        }
                        else if (obUsedCarsInfo[0].Price > 2000 && obUsedCarsInfo[0].Price < 10000)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Autos $2000 to $10000");
                        }
                        else if (obUsedCarsInfo[0].Price > 10000)
                        {
                            GeneralFunction.LinkInvoke(webBrowser1, "Autos $10000 upwards");
                        }
                    }
                    if (webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/?view=post&cityid=1&lang=en&catid=4&subcatid=29"
                        || webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/?view=post&cityid=1&lang=en&catid=4&subcatid=28"
                        || webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/?view=post&cityid=1&lang=en&catid=4&subcatid=30"
                        || webBrowser1.Url.ToString() == "http://classifieds.blackworld.com/?view=post&cityid=1&lang=en&catid=4&subcatid=31")
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites obblackworld = new classifieds_blackworld();
                        obblackworld.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        GeneralFunction.SetTextValue(webBrowser1, "email", comboBox2.Text);
                        GeneralFunction.FileUploadInvoke(webBrowser1, "pic[]");
                        GeneralFunction.RadioSetValue(webBrowser1, "agree", "1");
                    }
                    #endregion
                }
                if (comboBox1.Text == "extraclassifieds")
                {
                    #region extraclassifieds
                    if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                    {
                        if (webBrowser1.Url.ToString() == "http://extraclassifieds.com/")
                        {
                            eccount++;
                            if (eccount < 3)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Register a free account");
                                if (webBrowser1.DocumentText.Contains("<div id=\"flashmessage\" class=\"flashmessage flashmessage-ok\">"))
                                {
                                    Txt_Url.Visible = true;
                                    Navigate_btn.Visible = true;
                                }
                            }
                            if (eccount >= 3)
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Publish your ad for free");
                            }
                        }
                        if (webBrowser1.Url.ToString() == "http://extraclassifieds.com/user/register")
                        {
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            string username = comboBox2.Text;
                            string mail = comboBox2.Text;
                            Char[] seprt = { '@' };
                            string[] splitemail = username.Split(seprt);
                            username = splitemail[0].ToString();
                            GeneralFunction.SetTextValue(webBrowser1, "s_name", username);
                            GeneralFunction.SetTextValue(webBrowser1, "s_password", "UCEURV123");
                            GeneralFunction.SetTextValue(webBrowser1, "s_password2", "UCEURV123");
                            GeneralFunction.SetTextValue(webBrowser1, "s_email", comboBox2.Text);
                            GeneralFunction.SetTextValue(webBrowser1, "s_phone_mobile", obUsedCarsInfo[0].Phone);
                        }
                        //Register a free account
                        #region old

                        if (webBrowser1.Url.ToString() == "http://extraclassifieds.com/item/new")
                        {
                            //GeneralFunction.SetDropDownValue(webBrowser1, "catId", "  Cars");
                            if (rb_Trucks.Checked || rb_Vans.Checked)
                            {
                                SelectOption(webBrowser1, "  Vans, Trucks, Commercial Vehicles", "catId");
                            }
                            else
                            {
                                SelectOption(webBrowser1, "  Cars", "catId");
                            }
                            com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                            IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                            obUsedCarsInfo = objService.FindCarID(label10.Text);
                            IWebSites obextraclassifieds = new extraclassifieds();
                            obextraclassifieds.carpostfunc(webBrowser1, obUsedCarsInfo, true);

                            GeneralFunction.SetTextValue(webBrowser1, "contactEmail", comboBox2.Text);
                            GeneralFunction.SetTextValue(webBrowser1, "contactName", "UCEURVE");
                            SelectOption(webBrowser1, "United States", "countryId");
                            GeneralFunction.SetTextValue(webBrowser1, "city", obUsedCarsInfo[0].City);
                            GeneralFunction.SetTextValue(webBrowser1, "cityArea", obUsedCarsInfo[0].Phone);
                            SelectOption(webBrowser1, "Used", "meta[1]");
                            //GeneralFunction.FileUploadInvoke(webBrowser1, "photos[]");
                            //GeneralFunction.FileUploadInvoke(webBrowser1, "photos[]");
                            btnpostsubmit.Enabled = true;
                            btnpostsubmit.Visible = true;
                        }
                        if (webBrowser1.Url.ToString() == "http://extraclassifieds.com/cars-vehicles/cars")
                        {
                            btnpostsubmit.Enabled = false;
                            btnpostsubmit.Visible = false;
                            btnuploadtolive.Enabled = true;
                            btnuploadtolive.Visible = true;
                        }
                        #endregion
                    }
                    #endregion
                }
                if (comboBox1.Text == "meetpark")
                {
                    #region meetpark

                    string newurl = webBrowser1.Url.ToString();
                    if (newurl.Contains("cityid"))
                    {
                        newurl = newurl.Substring(newurl.IndexOf("cityid"));
                        newurl = newurl.Substring(newurl.IndexOf("="), newurl.IndexOf("&") - newurl.IndexOf("="));
                        newurl = newurl.Replace("=", "").Trim();
                    }
                    else if (newurl.Contains(sname))
                    {
                        newurl = Regex.Replace(newurl, @"[^0-9]", "");
                    }
                    #region new
                    if (webBrowser1.Url.ToString() == "http://www.meetpark.com/")
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        sname = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), label10.Text);
                        GeneralFunction.LinkInvoke(webBrowser1, sname);
                    }
                    if (webBrowser1.Url.ToString() == "http://www.meetpark.com/" + newurl + "-" + sname + "/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    }
                    else if (webBrowser1.Url.ToString() == "http://www.meetpark.com/index.php?view=post&cityid=" + newurl + "&lang=en")
                    {
                        //GeneralFunction.LinkInvoke(webBrowser1, "Change");
                        GeneralFunction.LinkInvoke(webBrowser1, "For Sale");
                    }
                    else if (webBrowser1.Url.ToString() == "http://www.meetpark.com/?view=post&cityid=" + newurl + "&lang=en&catid=4&shortcutregion=")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "cars+trucks");
                    }
                    //else if (webBrowser1.Url.ToString() == "http://www.meetpark.com/?view=selectcity&targetview=post&cityid=0&lang=en"
                    //  || webBrowser1.Url.ToString() == "http://www.meetpark.com/?view=selectcity&targetview=post")
                    //{
                    //    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    //    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    //    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    //    sname = StateName.GetStateName(obUsedCarsInfo, obUsedCarsInfo[0].State.ToString(), label10.Text);
                    //    GeneralFunction.LinkInvoke(webBrowser1, sname);
                    //}
                    //else if (webBrowser1.Url.ToString() == "http://www.meetpark.com/?view=post&postevent=&cityid=" + newurl + "&lang=en&catid=&subcatid=")
                    //{
                    //    GeneralFunction.LinkInvoke(webBrowser1, "For Sale");
                    //}

                    else if (webBrowser1.Url.ToString() == "http://www.meetpark.com/?view=post&cityid=" + newurl + "&lang=en&catid=4&subcatid=56&shortcutregion=")
                    {
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites obmeetpark = new meetpark();
                        obmeetpark.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        GeneralFunction.SetTextValue(webBrowser1, "email", comboBox2.Text);//obUsedCarsInfo[0].Email;
                        GeneralFunction.CheckedInvoke(webBrowser1, "agree");
                    }
                    #endregion
                    btnpostsubmit.Enabled = true;
                    btnpostsubmit.Visible = true;
                    #endregion
                }
                if (comboBox1.Text == "webleeg")
                {
                    #region webleeg
                    if (webBrowser1.Url.ToString() == "http://www.webleeg.com/register.php")
                    {
                        string username = comboBox2.Text;
                        string mail = comboBox2.Text;
                        Char[] seprt = { '@' };
                        string[] splitemail = username.Split(seprt);
                        username = splitemail[0].ToString();
                        GeneralFunction.SetTextValue(webBrowser1, "c[email]", mail);
                        GeneralFunction.SetTextValue(webBrowser1, "c[email_verifier]", mail);
                        GeneralFunction.SetTextValue(webBrowser1, "c[username]", username);
                        GeneralFunction.SetTextValue(webBrowser1, "c[password]", "UCEURV123");
                        GeneralFunction.SetTextValue(webBrowser1, "c[password_confirm]", "UCEURV123");
                        GeneralFunction.RadioSetValue(webBrowser1, "c[agreement]", "yes");
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "submit");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.webleeg.com/register.php?b=1")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "CLICK HERE");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.webleeg.com/")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "Post Ad");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.webleeg.com/index.php?a=4")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "New Classified");
                    }
                    if (webBrowser1.Url.ToString() == "http://www.webleeg.com/index.php?a=cart&action=new&main_type=classified")
                    {
                        GeneralFunction.RadioSetValue(webBrowser1, "b[leveled][cat][1]", "304");
                        GeneralFunction.SetDropDownNameandValue(webBrowser1, "select", "360");
                        com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                        IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                        obUsedCarsInfo = objService.FindCarID(label10.Text);
                        IWebSites obwebleeg = new webleeg();
                        obwebleeg.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    #endregion
                }
                //    btnpostupload.Visible = false;
                //    btnpostupload.Enabled = false;
                //    btnpostsubmit.Enabled = true;
                //    btnpostsubmit.Visible = true;
                //}

            }

            Cursor.Current = Cursors.Default;
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: hugo-mirad/Leads-upload
        private void btnpostupload_Click(object sender, EventArgs e)
        {
            textBox7.Focus();
            textBox2.Focus();
            if (comboBox2.Text != "")
            {
                try
                {
                   count = 0;
                    count++;
                    Cursor.Current = Cursors.WaitCursor;
                    com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                    IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                    obUsedCarsInfo = objService.FindCarID(label10.Text);
                    Globaltxtemail.txtemail = comboBox2.Text;
                    Globalpwd.pwd = textBox2.Text;
                    if (comboBox1.Text == "pinterest")
                    {
                        if (webBrowser1.Url.ToString() == "http://www.pinterest.com/vinayy5544/boards/" || webBrowser1.Url.ToString() == "http://www.pinterest.com/vinayy5544/boards/#")
                        {

                                // GeneralFunction.LinkInvoke(webBrowser1, "Create a board");
                                // GeneralFunction.LinkInvokeCollectorCarsPic(webBrowser1);

                                //GeneralFunction.LinkInvokepintrest(webBrowser1, "BoardCreateRep Module");

                                //com.unitedcarexchange.CarsService objService = new com.unitedcarexchange.CarsService();
                                //IList<com.unitedcarexchange.UsedCarsInfo> obUsedCarsInfo = new List<com.unitedcarexchange.UsedCarsInfo>();
                                //obUsedCarsInfo = objService.FindCarID(label10.Text);

                                IWebSites objClass = new Pintrest();

                                objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                                circularProgressControl2.Stop();
                                circularProgressControl2.Visible = false;
                                panel2.Visible = false;
                            //}

                        }
                    }
                    if (Website == "CarPosts")
                    {
                        IWebSites objClass = new CarPosts();
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        Cursor.Current = Cursors.Default;
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        btnpostupload.Enabled = false;
                    }
                    if (Website == "clazorg")
                    {
                        clz++;
                        clz1++;
                        Cursor.Current = Cursors.WaitCursor;
                        IWebSites objClass = new ClazOrg();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        Cursor.Current = Cursors.Default;
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        btnpostupload.Enabled = false;
                    }
                    if (Website == "JustgoodCars")
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        if (count == 1)
                        {
                            IWebSites objClass = new JustgoodCars();
                            objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                            webBrowser1.Navigate("http://www.justgoodcars.com/members/advertise.php");
                        }
                        if (count == 1)
                        {
                            webBrowser1.Navigate("http://www.justgoodcars.com/members/advertise.php");
                            label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                            btnpostupload.Enabled = false;
                        }
                        Cursor.Current = Cursors.Default;
                    }
                    if (Website == "Usadsciti")
                    {
                        // adsty++;
                        Cursor.Current = Cursors.WaitCursor;
                        IWebSites objClass = new Usadsciti();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        Cursor.Current = Cursors.Default;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                    }
                    if (Website == "www.adsciti.com")
                    {
                        // adsty++;
                        Cursor.Current = Cursors.WaitCursor;
                        IWebSites objClass = new Usadsciti();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        Cursor.Current = Cursors.Default;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                    }
                    else if (Website == "UsNetads")
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        IWebSites objClass = new UsnetAds();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        Cursor.Current = Cursors.Default;
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                       btnpostsubmit.Visible = true;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (Website == " kugli")
                    {
                        Kug = 0;
                        Kug++;
                        IWebSites objClass = new Kugli();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    else if (Website == "jeanza")
                    {
                        IWebSites objClass = new Jeanza();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        btnpostupload.Enabled = false;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                    }
                    else if (Website == "classifiedsvalley")
                    {
                        circularProgressControl2.Start();
                        panel2.Visible = true;
                        circularProgressControl2.Visible = true;
                        IWebSites objClass = new classifiedsvalley();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        btnpostupload.Enabled = false;
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                   else if (Website == "classifiedsciti")
                    {
                        IWebSites objClass = new classifiedsciti();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (Website == "usa.motoseller.com")
                    {
                        IWebSites objClass = new Motoseller();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostupload.Enabled = false;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        motosl = 0;
                        circularProgressControl2.Start();
                        panel2.Visible = true;
                        circularProgressControl2.Visible = true;
                        label49.Visible = true;
                    }
                    else if (Website == "americanclassifieds")
                    {
                        IWebSites objClass = new AmericanClassifieds();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (Website == "classifiedsforfree")
                    {
                        IWebSites objClass = new ClassifiedsForFree();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (Website == "epage")
                    {
                        IWebSites objClass = new epage();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        btnpostupload.Enabled = false;
                        circularProgressControl2.Start();
                        circularProgressControl2.Visible = true;
                        panel2.Visible = true;
                    }
                    else if (Website == "highlandclassifieds")
                    {
                        //GeneralFunction.LinkInvoke(webBrowser1, "Cars and Trucks");
                        IWebSites objClass = new highlandclassifieds();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        btnpostupload.Enabled = false;
                        circularProgressControl2.Start();
                        circularProgressControl2.Visible = true;
                        panel2.Visible = true;
                    }
                    else if (Website == "classifiededition")
                    {
                        circularProgressControl2.Start();
                        panel2.Visible = true;
                        circularProgressControl2.Visible = true;
                        IWebSites objClass = new ClassifiedEditor();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        btnpostupload.Enabled = false;
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (Website == "www.autoii.com")
                    {
                        IWebSites objClass = new Autoii();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        btnpostupload.Enabled = false;
                    }
                    else if (Website == "www.postfreeadshere.com")
                    {
                        IWebSites objClass = new PostFreeAdshere();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        btnpostupload.Enabled = false;
                        btnpostsubmit.Enabled = true;
                        btnpostsubmit.Visible = true;
                    }
                    else if (Website == " www.freeadlists.com")
                    {
                        IWebSites objClass = new FreeAddList();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                    }
                   else if (Website == "adsriver")
                    {
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        //GeneralFunction.LinkInvoke(webBrowser1, "Automotive");
                        Cursor.Current = Cursors.Default;
                        circularProgressControl2.Stop();
                        circularProgressControl2.Visible = false;
                        panel2.Visible = true;
                        circularProgressControl2.Visible = true;
                        btnpostsubmit.Visible = true;
                        btnpostsubmit.Enabled = true;
                        btnpostupload.Enabled = false;
                    }
                    else if (Website == "anunico")
                    {
                        textBox7.Focus();
                        anupic = 0;
                        circularProgressControl2.Start();
                        panel2.Visible = true;
                        circularProgressControl2.Visible = true;
                        btnpostupload.Enabled = false;
                        IWebSites objClass = new anunico();
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        label27.ForeColor = System.Drawing.Color.Red;
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    else if (Website == "classifieds4me")
                    {
                        cls4me = 0;

                        //               circularProgressControl2.Start();
                        //               panel2.Visible = true;
                        //               circularProgressControl2.Visible = true;
                        //               IWebSites objClass = new classifieds4me();
                        //               label27.Font = new System.Drawing.Font("Verdana", 8.0f,
                        //System.Drawing.FontStyle.Bold);
                        //               objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                        string suburl = webBrowser1.Url.ToString();
                        if (suburl.Contains("-classified-ads-"))
                        {
                            string split = suburl.ToString();
                            int index1 = split.IndexOf(".com/");
                            int end1 = split.IndexOf("-classified");
                            string c4mCity = split.ToString().Substring(index1, end1 - index1);
                            c4mCity = c4mCity.Replace(".com/", "");
                            string split1 = suburl.ToString();
                            int index2 = split1.IndexOf("ads-");
                            int end2 = split.Length;
                            string c4mCityId = split.ToString().Substring(index2, end2 - index2);
                            c4mCityId = c4mCityId.Replace("/", "");
                            c4mCityId = c4mCityId.Replace("ads-", "");
                            if (webBrowser1.Url.ToString() == "http://www.classifieds4me.com/" + c4mCity + "-classified-ads-" + c4mCityId + "/")
                            {
                                GeneralFunction.LinkInvoke(webBrowser1, "Post a FREE Classified Ad");
                            }
                        }
                    }
                    else if (Website == "myadmonster")
                    {
                        myads = 0;
                        circularProgressControl2.Start();
                        circularProgressControl2.Visible = true;
                        panel2.Visible = true;
                        GeneralFunction.SetDropDownNameandValue(webBrowser1, "sel_action", "post_1");
                        GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, " Select And Continue ");
                    }
                    else if (Website == "99localsearch")
                    {
                        IWebSites objClass = new local99search();
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    else if (Website == "freead1.net")
                    {
                        IWebSites objClass = new freead1();
                        label27.Font = new System.Drawing.Font("Verdana", 8.0f,System.Drawing.FontStyle.Bold);
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                    }
                    else if (Website == "facebook")
                    {
                        GeneralFunction.ButtonClickBYTypeAndValue(webBrowser1, "Log In");
                    }
                    else if (Website == "adpost us")
                    {
                        GeneralFunction.LinkInvoke(webBrowser1, "United States");
                    }
                    //           else if (Website == "classifiedads")
                    //           {
                    //               IWebSites objClass = new ClassifiedAdds();
                    //               label27.Font = new System.Drawing.Font("Verdana", 8.0f,
                    //System.Drawing.FontStyle.Bold);
                    //               objClass.carpostfunc(webBrowser1, obUsedCarsInfo,rb_Trucks.Checked);
                    //           }
                    else if (Website == "webcosmo")
                    {
                        // adsty++;
                        IWebSites objClass = new WebCosmo();
                        objClass.carpostfunc(webBrowser1, obUsedCarsInfo, rb_Trucks.Checked);
                        GeneralFunction.ButtonClickInvoke(webBrowser1, "ctl00$cphContent$ibContinue");
                        Cursor.Current = Cursors.WaitCursor;
                        Cursor.Current = Cursors.Default;
                        //label27.Font = new System.Drawing.Font("Verdana", 8.0f, System.Drawing.FontStyle.Bold);
                        //label27.ForeColor = System.Drawing.Color.Red;
                        //btnpostupload.Enabled = false;
                        //btnpostsubmit.Enabled = true;
                        //btnpostsubmit.Visible = true;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Temporarly Server is not Connecting .Please try after some times", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
            else
            {
                MessageBox.Show("Email text is empty;");
            }
            textBox7.Focus();
        }