/* private void OnGetDownloadedStringCompleted(object sender, DownloadStringCompletedEventArgs e) * { * if (e.Error == null && !string.IsNullOrEmpty(e.Result)) * { * // do something with e.Result string. * _results.Add(e.Result); * } * DownloadItem(); * } */ private void button1_Click(object sender, EventArgs e) { this.Hide(); RulesAndRegulations rar = new RulesAndRegulations(); rar.ShowDialog(); // Only This one GenerateFolder(); //button1.Text = "Question Paper is downloading.....\nPlease Wait..."; //button1.ForeColor = System.Drawing.Color.Green; //button1.Font = new Font(button1.Font.FontFamily, 18); // label1.Visible = true; //button2.Visible = false; // label1.ForeColor = System.Drawing.Color.Green; //label1.Font = new Font(button1.Font.FontFamily, 18); /* use Path.Combine to combine 2 strings to a path * File.WriteAllText(Path.Combine(dir, "log.txt"), "blah blah, text"); * * * * * * WebClient Client = new WebClient(); * wc.DownloadFile("http://i.stackoverflow.com/Content/Img/stackoverflow-logo-250.png", @"C:\\newfolder\\stackoverflowlogo.png"); * wc.DownloadFileCompleted += new AsyncCompletedEventHandler(FileDownloadComplete); * * Uri imageurl1 = new Uri("http://childzone.webege.com/Image/Q1.jpg"); * wc.DownloadFileAsync(imageurl1, "C:\\Image folder\\01.jpg"); */ }
/* private void OnGetDownloadedStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error == null && !string.IsNullOrEmpty(e.Result)) { // do something with e.Result string. _results.Add(e.Result); } DownloadItem(); } */ private void button1_Click(object sender, EventArgs e) { this.Hide(); RulesAndRegulations rar = new RulesAndRegulations(); rar.ShowDialog(); // Only This one GenerateFolder(); //button1.Text = "Question Paper is downloading.....\nPlease Wait..."; //button1.ForeColor = System.Drawing.Color.Green; //button1.Font = new Font(button1.Font.FontFamily, 18); // label1.Visible = true; //button2.Visible = false; // label1.ForeColor = System.Drawing.Color.Green; //label1.Font = new Font(button1.Font.FontFamily, 18); /* use Path.Combine to combine 2 strings to a path File.WriteAllText(Path.Combine(dir, "log.txt"), "blah blah, text"); WebClient Client = new WebClient(); wc.DownloadFile("http://i.stackoverflow.com/Content/Img/stackoverflow-logo-250.png", @"C:\\newfolder\\stackoverflowlogo.png"); wc.DownloadFileCompleted += new AsyncCompletedEventHandler(FileDownloadComplete); Uri imageurl1 = new Uri("http://childzone.webege.com/Image/Q1.jpg"); wc.DownloadFileAsync(imageurl1, "C:\\Image folder\\01.jpg"); */ }