PICHU.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
namespace Image_Downloader
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string path = "";
int min;
int max;
string imagetype;
int Success = 0;
int Error = 0;
List<string> wl = new List<string>();
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
imagetype = textBox2.Text;
textBox3.Text = textBox1.Text + numericUpDown1.Value.ToString() + imagetype;
CheckButtons();
textBox3.BackColor = Color.Lime;
textBox3.ForeColor = Color.Red;
min = Convert.ToInt32(numericUpDown1.Value);
max = Convert.ToInt32(numericUpDown2.Value);
DevelopingLinks();
}
private void button2_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
{
path = fbd.SelectedPath + "\\";
textBox4.Text = path;
CheckButtons();
}
}
private void button3_Click(object sender, EventArgs e)
{
if (button3.Text == "Start")
{
int totalimages = Convert.ToInt32(numericUpDown2.Value - numericUpDown1.Value) + 1;
DialogResult message = MessageBox.Show("Total Images To Be Downloaded = " + totalimages + "\nSave To: " + path, "Checking", MessageBoxButtons.YesNo);
if (message == DialogResult.Yes)
{
button3.Text = "Stop";
disabler();
Downloader();
}
}
else
{
button3.Text = "Start";
enabler();
}
}
public void CheckButtons()
{
if (textBox3.Text.Length > 7 && textBox4.Text.Length > 3)
{
button3.Enabled = true;
}
}
public void DevelopingLinks()
{
if (richTextBox1.Text == "")
{
richTextBox1.Clear();
for (int a = Convert.ToInt32(min); a <= Convert.ToInt32(max); a++)
{
string weblink = textBox1.Text + a + imagetype;
wl.Add(weblink);
richTextBox1.Text += "Adding Link: " + weblink + "\nTotal Links: " + a + "\n";
if (a >= max + min + 1)
{
MessageBox.Show("Completed");
}
}
}
else
{
DialogResult clearit = MessageBox.Show("Clear Current Links For New Ones?", "Clear?", MessageBoxButtons.YesNo);
if (clearit == DialogResult.Yes)
{
richTextBox1.Clear();
for (int a = Convert.ToInt32(min); a <= Convert.ToInt32(max); a++)
{
string weblink = textBox1.Text + a + imagetype;
wl.Add(weblink);
richTextBox1.Text += "Adding Link: " + weblink + "\nTotal Links: " + a + "\n";
if (a >= max + min + 1)
{
MessageBox.Show("Completed");
}
}
}
}
}
public void Downloader()
{
int newsetvalue = Convert.ToInt32(numericUpDown1.Value);
for (int a = newsetvalue; a < max; a++)
{
try
{
string uri = wl[newsetvalue];
WebClient wc = new WebClient();
Stream img = wc.OpenRead(uri);
Bitmap bp = new Bitmap(img);
if (bp != null)
{
bp.Save(path + newsetvalue + textBox2.Text);
Success++;
richTextBox1.Text += "Successfull Image: " + path + a + textBox2.Text + "\n";
newsetvalue++;
label4.Text = "Successful Images: " + Success + " Failed Images: " + Error;
}
else
{
a++;
Error++;
label4.Text = "Successful Images: " + Success + " Failed Images: " + Error;
}
if (a == max)
{
MessageBox.Show("Completed!");
button3.Text = "Start";
richTextBox1.Text += "Failed Image: " + path + newsetvalue + textBox2.Text + "\n";
}
img.Flush();
img.Close();
wc.Dispose();
}
catch
{
}
}
}
public void disabler()
{
textBox1.ReadOnly = true;
textBox2.ReadOnly = true;
numericUpDown1.Enabled = false;
numericUpDown2.Enabled = false;
button1.Enabled = false;
button2.Enabled = false;
minmaxcheck.Stop();
}
public void enabler()
{
textBox1.ReadOnly = false;
textBox2.ReadOnly = false;
numericUpDown1.Enabled = true;
numericUpDown2.Enabled = true;
button1.Enabled = true;
button2.Enabled = true;
minmaxcheck.Start();
}
private void minmaxcheck_Tick(object sender, EventArgs e)
{
if (numericUpDown1.Value >= numericUpDown2.Value)
{
numericUpDown1.Value = numericUpDown2.Value - 1;
}
}
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.