All pastes #959145 Raw Edit

Anonymous

public text v1 · immutable
#959145 ·published 2008-03-27 04:57 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
    {
       

        public DbDownloadForm()
        {
            InitializeComponent();
        }

        private void downloadButton_Click(object sender, EventArgs e)
        {
            WebClient engineer = new WebClient();
            WebClient codes = new WebClient();
            try
            {
            engineer.DownloadFile("https://foo.com/engineer.mdb", "C:\\c\foo\\engineer.mdb");
            codes.DownloadFile("https://foo.com/engineer/codes.mdb", "C:\\foo\\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();
        }
    }
}