From b1a264b02327899ace9727e3f78069c82f4799e7 Mon Sep 17 00:00:00 2001 From: Vichingo455 <59311016+Vichingo455@users.noreply.github.com> Date: Mon, 3 Apr 2023 21:04:27 +0200 Subject: [PATCH] v1.3 - Updated algorithm, more readable --- Win95Keygen/Form1.Designer.cs | 1 - Win95Keygen/Form1.cs | 17 +++-------------- Win95Keygen/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Win95Keygen/Form1.Designer.cs b/Win95Keygen/Form1.Designer.cs index 2b10b86..ac4d518 100644 --- a/Win95Keygen/Form1.Designer.cs +++ b/Win95Keygen/Form1.Designer.cs @@ -86,7 +86,6 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "Form1"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Windows 95 Key Generator"; ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/Win95Keygen/Form1.cs b/Win95Keygen/Form1.cs index 620ca1a..b9e8ff3 100644 --- a/Win95Keygen/Form1.cs +++ b/Win95Keygen/Form1.cs @@ -45,20 +45,9 @@ namespace Win95Keygen public static string RandomDivisibleBy7() { Random rand = new Random(); - int i = rand.Next(1,3); - string output = "31584"; //By fallback or else VS 2008 errors out - if (i == 1) - { - output = "31584"; - } - else if (i == 2) - { - output = "39207"; - } - else if (i == 3) - { - output = "77777"; - } + string[] yeararray = { "31584", "39207", "77777", "13811", "97408", "65908", "34421", "96526", "82121" }; + int index = rand.Next(yeararray.Length); + string output = yeararray[index]; return output; } } diff --git a/Win95Keygen/Properties/AssemblyInfo.cs b/Win95Keygen/Properties/AssemblyInfo.cs index fbe1ba7..4cedabd 100644 --- a/Win95Keygen/Properties/AssemblyInfo.cs +++ b/Win95Keygen/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ using System.Resources; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] [assembly: NeutralResourcesLanguageAttribute("en")]