示例#1
0
        private void BT_Go_Click(object sender, EventArgs e)
        {
            if (TB_Address.Text.Trim().Length <= 0)
            {
                return;
            }
            txtHTML.Text = "";
            string sAddress = TB_Address.Text;

            if (sAddress.ToLower().StartsWith("http://") == false && sAddress.ToLower().StartsWith("https://") == false)
            {
                sAddress = "http://" + sAddress;
            }

            if (HTMLultility.RemoteFileExists(sAddress) == false)
            {
                MessageBox.Show("Link không tồn tại", "MVT - Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                TB_Address.Focus();
                return;
            }

            using (WebClient client = new WebClient())
            {
                try
                {
                    txtHTML.Text = client.DownloadString(sAddress);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
        }
示例#2
0
        private void BT_Go_Click(object sender, EventArgs e)
        {
            if (TB_Address.Text.Trim().Length <= 0)
            {
                return;
            }
            List_Email.Items.Clear();
            List_Link.Items.Clear();
            //TB_HTML.Text = "";
            iIndex = 0;
            string sAddress = TB_Address.Text;

            if (sAddress.ToLower().StartsWith("http://") == false && sAddress.ToLower().StartsWith("https://") == false)
            {
                sAddress = "http://" + sAddress;
            }

            if (HTMLultility.RemoteFileExists(sAddress) == false)
            {
                MessageBox.Show("Link không tồn tại", "MVT - Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                TB_Address.Focus();
                return;
            }

            sHostname           = HTMLultility.GetHotName(sAddress);
            Pic_Loading.Visible = true;
            List_Link.Items.Add(sAddress);
            List_Link.SelectedIndex = iIndex;

            thrHTML = new Thread(new ThreadStart(GetHTML));
            thrHTML.Start();

            timer1.Enabled = true;

            TB_Address.Enabled     = false;
            BT_Go.Enabled          = false;
            BT_Stop.Enabled        = true;
            BT_ExportEmail.Enabled = false;
            BT_ExportLink.Enabled  = false;
        }
示例#3
0
 private void GetHTML_Load(object sender, EventArgs e)
 {
     this.Top  = iTop;
     this.Left = iLeft;
     TB_Address.Focus();
 }
示例#4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Pic_Loading.Visible = false;
     TB_Address.Focus();
 }