From b0644a50bdce6101a90fa90bc42650bdfa945ddf Mon Sep 17 00:00:00 2001 From: Vichingo455 <59311016+Vichingo455@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:52:29 +0200 Subject: [PATCH] v1.2 Improved algorithm, centered the window --- Win95Keygen/Form1.Designer.cs | 1 + Win95Keygen/Form1.cs | 10 +++++----- Win95Keygen/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Win95Keygen/Form1.Designer.cs b/Win95Keygen/Form1.Designer.cs index ac4d518..2b10b86 100644 --- a/Win95Keygen/Form1.Designer.cs +++ b/Win95Keygen/Form1.Designer.cs @@ -86,6 +86,7 @@ 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 e7766d7..620ca1a 100644 --- a/Win95Keygen/Form1.cs +++ b/Win95Keygen/Form1.cs @@ -25,20 +25,20 @@ namespace Win95Keygen //Generate day from 100 to 366 Random rand; rand = new Random(); - int day = rand.Next(100,366); - + int day = rand.Next(100, 366); + //Generate year string[] yeararray = { "95", "96", "97", "98", "99", "00", "01", "02", "03" }; int index = rand.Next(yeararray.Length); string year = yeararray[index]; - + //Static numbers divisible by 7 string divisibleby7 = RandomDivisibleBy7(); //Random numbers rand = new Random(); - int randomnumbers = rand.Next(10000,99999); + int randomnumbers = rand.Next(10000, 99999); //Make the windows 95 key output - + //TODO: Use "0XXXXXX" instead of "00XXXXX" return day.ToString() + year + "-OEM-" + "00" + divisibleby7 + "-" + randomnumbers.ToString(); } diff --git a/Win95Keygen/Properties/AssemblyInfo.cs b/Win95Keygen/Properties/AssemblyInfo.cs index 001d0e1..fbe1ba7 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.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: NeutralResourcesLanguageAttribute("en")]