Improved algorithm, centered the window
This commit is contained in:
Vichingo455 2023-04-01 15:52:29 +02:00 committed by GitHub
parent b1cba60440
commit b0644a50bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -86,6 +86,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false; this.MaximizeBox = false;
this.Name = "Form1"; this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Windows 95 Key Generator"; this.Text = "Windows 95 Key Generator";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -25,20 +25,20 @@ namespace Win95Keygen
//Generate day from 100 to 366 //Generate day from 100 to 366
Random rand; Random rand;
rand = new Random(); rand = new Random();
int day = rand.Next(100,366); int day = rand.Next(100, 366);
//Generate year //Generate year
string[] yeararray = { "95", "96", "97", "98", "99", "00", "01", "02", "03" }; string[] yeararray = { "95", "96", "97", "98", "99", "00", "01", "02", "03" };
int index = rand.Next(yeararray.Length); int index = rand.Next(yeararray.Length);
string year = yeararray[index]; string year = yeararray[index];
//Static numbers divisible by 7 //Static numbers divisible by 7
string divisibleby7 = RandomDivisibleBy7(); string divisibleby7 = RandomDivisibleBy7();
//Random numbers //Random numbers
rand = new Random(); rand = new Random();
int randomnumbers = rand.Next(10000,99999); int randomnumbers = rand.Next(10000, 99999);
//Make the windows 95 key output //Make the windows 95 key output
//TODO: Use "0XXXXXX" instead of "00XXXXX" //TODO: Use "0XXXXXX" instead of "00XXXXX"
return day.ToString() + year + "-OEM-" + "00" + divisibleby7 + "-" + randomnumbers.ToString(); return day.ToString() + year + "-OEM-" + "00" + divisibleby7 + "-" + randomnumbers.ToString();
} }

View File

@ -33,6 +33,6 @@ using System.Resources;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")] [assembly: NeutralResourcesLanguageAttribute("en")]