All pastes #959121 Raw Edit

Someone

public text v1 · immutable
#959121 ·published 2008-03-27 04:20 UTC
rendered paste body
using System;
using System.Net;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DbDownload
{
    public partial class DbDownloadForm : Form
    {
        ServicePointManager.ServerCertificateValidationCallback =
      new RemoteCertificateValidationCallback
         (IgnoreCertificateErrorHandler);

        private bool IgnoreCertificateErrorHandler(object sender,
   System.Security.Cryptography.X509Certificates.X509Certificate certificate,
   System.Security.Cryptography.X509Certificates.X509Chain chain,
   System.Net.Security.SslPolicyErrors sslPolicyErrors)
        {
            return true;
        }

        public DbDownloadForm()
        {
            InitializeComponent();
        }

        private void downloadButton_Click(object sender, EventArgs e)
        {
            WebClient engineer = new WebClient();
            WebClient codes = new WebClient();
            try
            {
            engineer.DownloadFile("https://bridge.compucom.com/content_upload/largefiles/Airtime/engineer/engineer.mdb", "C:\\Program Files\\CompuCom AIRTime\\engineer.mdb");
            codes.DownloadFile("https://bridge.compucom.com/content_upload/largefiles/Airtime/engineer/codes.mdb", "C:\\Program Files\\CompuCom AIRTime\\codes.mdb");
            engineerLabel.Text = "Downloaded";
            codesLabel.Text = "Downloaded";
            }
            catch(Exception q)
            {
                MessageBox.Show("Error. Please try again.\n" + q, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                engineerLabel.Text = "Error";
                codesLabel.Text = "Error";
            }
        }

        private void DbDownloadForm_Load(object sender, EventArgs e)
        {
            this.ControlBox = true;
        }

        private void exitButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}