Example #1
0
 private void btnGuiPhanHoi_Click(object sender, EventArgs e)
 {
     if (txtTieuDe.Text == "")
     {
         XtraMessageBox.Show("Vui lòng điền tiêu đề", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else if (txtNoidung.Text == "")
     {
         XtraMessageBox.Show("Vui lòng điền nội dung", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         try
         {
             LoadingInForm loading = new LoadingInForm(splashScreenManager1);
             loading.ShowWaitForm();
             string mailBodyhtml = "<p>" + txtNoidung.Text + "</p>";
             var    msg          = new MailMessage("*****@*****.**", "*****@*****.**", txtTieuDe.Text, mailBodyhtml);
             msg.IsBodyHtml = true;
             var smtpClient = new SmtpClient("smtp.gmail.com", 587);
             smtpClient.UseDefaultCredentials = true;
             smtpClient.Credentials           = new NetworkCredential("*****@*****.**", "hieusl1996");
             smtpClient.EnableSsl             = true;
             smtpClient.Send(msg);
             loading.CloseWaitForm();
             XtraMessageBox.Show("Phản hồi đã được gửi thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception ex)
         {
             XtraMessageBox.Show(ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Example #2
0
 private void btnQuet_Click(object sender, EventArgs e)
 {
     if (txtDiaChi.Text == "")
     {
         XtraMessageBox.Show("Lỗi: Chưa nhập địa chỉ URL", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         if (!CheckValidURL(txtDiaChi.Text))
         {
             XtraMessageBox.Show("URL không hợp lệ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             LoadingInForm loading = new LoadingInForm(splashScreenManager1);
             loading.ShowWaitForm();
             RemovePreviousSeries();
             String      url = txtDiaChi.Text;
             HttpsToHttp cv  = new HttpsToHttp(url);
             url = cv.Convert();
             GetContentFromURL get     = new GetContentFromURL(new HistoryItem(url, "", DateTime.Now));
             String            content = get.ExtractContentFromUrl();
             if (content != "")
             {
                 XayDungBieuDo(content);
                 loading.CloseWaitForm();
             }
             else
             {
                 loading.CloseWaitForm();
                 XtraMessageBox.Show("Không thể tải nội dung từ URL", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
Example #3
0
 private void btnDownload_Click(object sender, EventArgs e)
 {
     if (txtURL.Text == "")
     {
         XtraMessageBox.Show("Vui lòng điền dữ liệu URL!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         if (!CheckValidURL(txtURL.Text))
         {
             XtraMessageBox.Show("URL không hợp lệ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             LoadingInForm loading = new LoadingInForm(splashScreenManager1);
             loading.ShowWaitForm();
             listboxImage.Items.Clear();
             foreach (string image in ScanImage(txtURL.Text))
             {
                 listboxImage.Items.Add(image);
             }
             loading.CloseWaitForm();
         }
     }
 }
Example #4
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            String path = txtPath.Text;

            String[] lines = System.IO.File.ReadAllLines(path);
            listviewURL.SmallImageList = imageList1;
            foreach (string URL in lines)
            {
                HistoryItem item = new HistoryItem();
                item.URL = URL;
                GetContentFromURL get     = new GetContentFromURL(item);
                string            content = get.ExtractContentFromUrl();
                ListViewItem      lvi;
                if (content == "")
                {
                    lvi = new ListViewItem("", 1);
                }
                else
                {
                    lvi = new ListViewItem("", 0);
                }
                string mainContent = Scan(content);
                lvi.SubItems.Add(URL);
                lvi.SubItems.Add(content);
                lvi.SubItems.Add(mainContent);
                listviewURL.Items.Add(lvi);
            }
            loading.CloseWaitForm();
        }
Example #5
0
        private void FirefoxExtract(int NumURL)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            FirefoxHistoryExtract extract = new FirefoxHistoryExtract(NumURL);
            List <HistoryItem>    list    = extract.GetHistory();

            SetValueToListView(list);
            loading.CloseWaitForm();
        }
Example #6
0
        private void ChromeExtract(int NumURL)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            ChromeHistoryExtract extract = new ChromeHistoryExtract(Environment.UserName, NumURL);
            List <HistoryItem>   list    = extract.getHistoryBrowser();

            SetValueToListView(list);
            loading.CloseWaitForm();
        }
Example #7
0
        private void btnView_Click(object sender, EventArgs e)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager2);

            loading.ShowWaitForm();
            if (listboxImage.SelectedIndex != -1)
            {
                boxImage.Image = ImageFromURL(listboxImage.SelectedItem.ToString());
            }
            loading.CloseWaitForm();
        }
Example #8
0
        private void btnQuetTuFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            frmQuetFileLog frm = new frmQuetFileLog();

            frm.MdiParent = this;
            frm.Show();
            loading.CloseWaitForm();
        }
Example #9
0
        private void btnHinhAnh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            frmTaiHinhAnh frm = new frmTaiHinhAnh();

            frm.MdiParent = this;
            frm.Show();
            loading.CloseWaitForm();
        }
Example #10
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            frmDanhGiaURL frm = new frmDanhGiaURL();

            frm.MdiParent = this;
            frm.Show();
            loading.CloseWaitForm();
        }
Example #11
0
        private void IEExtract(int NumURL)
        {
            LoadingInForm loading = new LoadingInForm(splashScreenManager1);

            loading.ShowWaitForm();
            IEHistoryExtract   extract = new IEHistoryExtract();
            List <HistoryItem> list    = extract.GetHistory(NumURL);

            if (list != null)
            {
                SetValueToListView(list);
            }
            loading.CloseWaitForm();
        }