Exemplo n.º 1
0
        private void pcr_form_Click(object sender, EventArgs e)
        {
            flp_liste.Controls.Clear();
            usr_form usrListe = new usr_form();

            LinkForm("http://mustafauzun0.16mb.com/FORM/", flp_liste, usrListe);
        }
Exemplo n.º 2
0
        void LinkForm(string htmlLink, FlowLayoutPanel flp, UserControl usr)
        {
            string htmlVeri;

            using (WebClient client = new WebClient())
            {
                client.Encoding = Encoding.UTF8;
                htmlVeri        = client.DownloadString(htmlLink);
            }
            Regex r = new Regex(@"<a.*?href=(""|')(?<href>.*?)(""|').*?>(?<value>.*?)</a>");

            for (int i = 1; i < r.Matches(htmlVeri).Count; i++)
            {
                usr = new usr_form();
                string[] isim = r.Matches(htmlVeri)[i].Groups["value"].Value.Split('.');
                for (int x = 0; x < isim.Length - 1; x++)
                {
                    ((usr_form)usr).lbl_ad.Text += isim[x];
                }

                ((usr_form)usr).link = r.Matches(htmlVeri)[i].Groups["href"].Value;
                flp.Controls.Add(usr);
            }
        }