Post: Redone (User Serial and ID Creator)
01-03-2013, 04:54 AM #1
Pichu
RIP PICHU.
(adsbygoogle = window.adsbygoogle || []).push({});
    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.Security.Cryptography;
using System.Net;


namespace Program_Load
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


string Username, Password, Serial, Unique_Serial, Unique_Serial_Raw, Machine_Name, Unique_ID_Raw, Unique_ID;
string Invalid_Serial_Characters = "DKLPQUXY-";
string Invalid_ID_Character = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-";
int Max_ID_Length, Max_Serial_Length, Add_Serial_Dash, Max_Dashes;
bool InvalidSerialChar = true;
bool InvalidIDChar = true;
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
UTF32Encoding utf32 = new UTF32Encoding();
UTF8Encoding utf8 = new UTF8Encoding();


private void Form1_Load(object sender, EventArgs e)
{
Max_ID_Length = 2;
Max_Serial_Length = 20;
Add_Serial_Dash = 0;
Max_Dashes = 4;
Machine_Name = System.Environment.MachineName;
Unique_Serial_Raw = BitConverter.ToString(md5.ComputeHash(utf32.GetBytes(Machine_Name)));
foreach (char a in Unique_Serial_Raw)
{
foreach (char b in Invalid_Serial_Characters)
{
if (Char.ToUpper(a) == b)
{
InvalidSerialChar = true;
}
}
foreach (char b in Invalid_ID_Character)
{
if (Char.ToUpper(a) == b)
{
InvalidIDChar = true;
}
}
if (InvalidSerialChar == false)
{
if (Max_Serial_Length != 0)
{
Max_Serial_Length--;
Unique_Serial += a;
}
if (Add_Serial_Dash == 3)
{
if (Max_Dashes != 0)
{
Max_Dashes--;
Unique_Serial += "-";
Add_Serial_Dash = 0;
}
}
else { Add_Serial_Dash++; }
}
if (InvalidIDChar == false)
{
if (Max_ID_Length != 0)
{
Max_ID_Length--;
int convert_a = (int)a * 2;
Unique_ID += convert_a;
}
}
InvalidIDChar = false;
InvalidSerialChar = false;
}
Unique_ID_Label.Text += Unique_ID;
Serial_Box.Text += Unique_Serial;
}


private void Login_Btn_Click(object sender, EventArgs e)
{
Username = Username_Box.Text;
Password = Password_Box.Text;
Serial = Serial_Box.Text;

}


private void Register_Btn_Click(object sender, EventArgs e)
{


}
}
}




*Note, MD5 is based off of Binary readings, the extra (Invalid characters) are there to throw off those who are inexperienced and decide to take a look at the program using ILSpy-like programs.

When complete, the only thing that will be bad about this sort of log in is that:
A) The user must have internet connection as the Username/Password will be checked with a file and then will return a value that will check to see if the user is on the correct system.
B) The user must use the same computer or computer with the same name. This just makes it harder for someone wrong to log in.
C) You must be the one to confirm registration and set things up.
(adsbygoogle = window.adsbygoogle || []).push({});
01-04-2013, 06:49 PM #2
Could you make the code for visual basic?
01-05-2013, 03:12 AM #3
Pichu
RIP PICHU.
Originally posted by HD View Post
Could you make the code for visual basic?


Honestly, I haven't worked with VB.NET in awhile so I wouldn't be able to do it off the top of my head. Sorry.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo