aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-07-26 21:00:35 -0400
committerlempamo <[email protected]>2017-07-26 21:00:35 -0400
commite1a0433b6bac1a0db985e40b8e94cd43d0f7302a (patch)
tree24a838b2667eaa6c2659d749194f00889fde466f /TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs
parenta852b2c7f2bb372a89e78e805298c33c00ebe924 (diff)
downloadhistacom2-e1a0433b6bac1a0db985e40b8e94cd43d0f7302a.tar.gz
histacom2-e1a0433b6bac1a0db985e40b8e94cd43d0f7302a.tar.bz2
histacom2-e1a0433b6bac1a0db985e40b8e94cd43d0f7302a.zip
fixing alexcode in downloader, part 1
Diffstat (limited to 'TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs')
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs33
1 files changed, 18 insertions, 15 deletions
diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs
index 276ca7f..ce71b40 100644
--- a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs
+++ b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs
@@ -10,23 +10,16 @@ namespace TimeHACK.OS.Win95.Win95Apps
public WinClassicDownloader()
{
InitializeComponent();
-
}
- private string DownloadSpeed(string str)
+ private string downloadSpeed()
{
Random rnd = new Random();
- int dl1 = rnd.Next(7, 9);
- int dl2 = rnd.Next(1, 9);
- int dl3 = rnd.Next(1, 9);
- string speed = dl1.ToString() + "." + dl2.ToString() + dl3.ToString();
- return speed;
+ return rnd.Next(7, 9).ToString() + "." + rnd.Next(7, 9).ToString() + rnd.Next(7, 9).ToString();
}
int amountToDL = 100;
int amountDLed = 0;
- Windows95 Windows95 = new Windows95();
-
private void WinClassicDownloader_Load(object sender, EventArgs e)
{
@@ -37,11 +30,21 @@ namespace TimeHACK.OS.Win95.Win95Apps
private void dlTimer_Tick(object sender, EventArgs e)
{
amountDLed = amountDLed + 8;
- if(8 > amountToDL - amountDLed){
+ if (8 > amountToDL - amountDLed)
+ {
progBar.Value = 100;
- amountLbl.Text = ("Downloaded " + amountDLed + " KB out of " + amountToDL + " KB");
+ amountLbl.Text = $"Downloaded {amountDLed} KB out of {amountToDL}";
- if (appName.Text == "Downloading: Guess The Number")
+ switch (appName.Text)
+ {
+ case "Downloading: FTP Client":
+ CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "FTP Client setup.exe"), "ftp client setup");
+ break;
+ case "Downloading: Web Chat 1998":
+ CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "Web Chat Setup.exe"), "web chat setup");
+ break;
+ }
+ /* if (appName.Text == "Downloading: Guess The Number")
{
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "Guess The Number Setup.exe"), "GuessTheNumber");
}
@@ -72,7 +75,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
if (appName.Text == "Downloading: FTP Client")
{
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "FTP Client setup.exe"), "ftp client setup");
- }
+ } */
((Form)this.TopLevelControl).Close();
dlTimer.Stop();
}
@@ -81,12 +84,12 @@ namespace TimeHACK.OS.Win95.Win95Apps
progBar.Maximum = amountToDL;
progBar.Value = amountDLed;
}
- amountLbl.Text = ("Downloaded " + amountDLed + " KB out of " + amountToDL);
+ amountLbl.Text = $"Downloaded {amountDLed} KB out of {amountToDL}";
}
private void dlSpeed_Tick(object sender, EventArgs e)
{
- transferLbl.Text = ("Transfer speed: " + DownloadSpeed("") + " KB/s");
+ transferLbl.Text = $"Transfer speed: {downloadSpeed()} KB/s";
}
}
}