Jag tyckte att denna text räckte fint
loginscript VB
kan inte direkt hjälpa till, men här är en kod jag använder till login-program
för VB2005:
'Rickythemaniac login system
'This code right here is for the "CREATE ACCOUNT" button.
'Check if the " Account Folder " Exists.
If My.Computer.FileSystem.DirectoryExists("C:\Accounts\") = True Then
'If it does Exist, Do nothing!
Else
' If it does NOT! exist, Create the folder.
MkDir("C:\Accounts")
End If
'Check if THE Account the user is making already Exists.
If My.Computer.FileSystem.DirectoryExists("C:\Accounts\" + TextBox1.Text + "\") = True Then
'If it does! Show an ERROR message.
MsgBox("Error, Account is already in Use", MsgBoxStyle.Critical)
Else
'Check if the Username is Empty
If TextBox1.Text = "" Then
'if it is Empty, Show an Error Message.
MsgBox("Error, Your Account Must have at least 1 Letter in it.", MsgBoxStyle.Information)
Else
'Check if they inputed a Password for their Account.
If TextBox2.Text = "" Then
'If they did Not input a Password, Show an Error message.
MsgBox("Error, Please Input a Password for your Account")
Else
'If they Did everything Correctly, The Account Will be created.
MkDir("C:\Accounts\" + TextBox1.Text)
Dim Username As New System.IO.StreamWriter("C:\Accounts\" + TextBox1.Text + "\" + "Username.txt")
Username.Write(TextBox1.Text)
Username.Close()
Dim Password As New System.IO.StreamWriter("C:\Accounts\" + TextBox1.Text + "\" + "Password.txt")
Password.Write(TextBox2.Text)
Password.Close()
Me.Close()
End If
End If
End If
'If Username is Empty
If TextBox1.Text = "" Then
'Show an Error Message.
MsgBox("Error, You need at least 1 Letter on your Username.")
Else
'Check if the Account you are trying to log into, Exists.
If My.Computer.FileSystem.DirectoryExists("C:\Accounts\" + TextBox1.Text + "\") Then
'Create some Variables that will be used, to read the Username/Password Text Files.
Dim Userread As New System.IO.StreamReader("C:\Accounts\" + TextBox1.Text + "\" + "Username.txt")
Dim Userline As String
Dim Passread As New System.IO.StreamReader("C:\Accounts\" + TextBox1.Text + "\" + "Password.txt")
Dim Passline As String
Do
Passline = TextBox2.Text
Userline = Userread.ReadLine()
Console.WriteLine(Passline)
Console.WriteLine(Userline)
Loop Until Userline Is Nothing
'If Password is Empty
If TextBox2.Text = "" Then
'Give an Error Message.
MsgBox("Error, Please Input Password", MsgBoxStyle.Critical)
Else
'Check if the Password you inputed, Matches the one on the Textfile
'If it does, Congrats.
If Passline = Passread.ReadLine() = True Then
'Show a Welcome Message if the Password is Correct.
MsgBox("Welcome to the System " + TextBox1.Text + "!.")
Else
'Show a message stating Password is INCORRECT
MsgBox("Incorrect Password; Sorry " + TextBox1.Text, MsgBoxStyle.Information)
End If
End If
Else
'If! the Account Does NOT! exist. Show an Error Message.
MsgBox("Error, That Username Does Not Exist.", MsgBoxStyle.Critical)
End If
End If
- Igår Allt du behöver veta om knappkommandon i Windows 11 14
- Igår Switch 2 ryktas få magnetiska Joy-Cons: Så kan det fungera 18
- Igår Testpilot: Phanteks XT Pro Ultra – Prisvärt och modernt chassi 2
- Igår AMD:s planerade toppmodell i RDNA 4-familjen var en bjässe 30
- 30 / 4 Bang & Olufsen vrider tillbaka klockan – återlanserar cd-spelare från 1996 38
- Dags att byta ut dino-datorn mot liten tyst maskin med bra grafik5
- Bitcoin ATH i SEK61
- Allt du behöver veta om knappkommandon i Windows 1114
- Nödvändigt att mina BTC? Miner beställd.6
- TV ibland extremt seg (Sony Android).26
- Switch 2 ryktas få magnetiska Joy-Cons: Så kan det fungera18
- Rabbel.se - Ett dagligt ordspel722
- Wordle på svenska - ordlig.se7871
- Är detta bygge bra för 1440p gaming?4
- Apple öppnar upp App Store55
- Säljes Benq XL2746K
- Säljes Nvidia RTX 3090 TI
- Säljes Gamingdator (RTX 2070, i7 10700K)
- Säljes Diverse rensning. Mobo, NAS, PS2, Nes-spel, Game and Watch, kameror
- Säljes Gigabyte 2070 Super OC
- Skänkes Bortskänkes: D-Link 4-port KVM Switch
- Säljes Skärm: AOC 34" (3440 x 1440) 144hz
- Säljes Gamingdator - Ryzen 7 7800x3d, 7900 XTX Red Devil
- Säljes Keychron Q1 svart med Gateron silent ink samt Glorious GPBT vita keycaps
- Säljes Netgate 2100 Base PFSense+ Security Gateway
- Discord uttalar sig efter att 14 000 servrar skördats på meddelanden7
- Allt du behöver veta om knappkommandon i Windows 1114
- Switch 2 ryktas få magnetiska Joy-Cons: Så kan det fungera18
- Testpilot: Phanteks XT Pro Ultra – Prisvärt och modernt chassi2
- Alternativa webbläsaren Arc kommer till Windows30
- AMD:s planerade toppmodell i RDNA 4-familjen var en bjässe30
- Bang & Olufsen vrider tillbaka klockan – återlanserar cd-spelare från 199638
- Uppdatering till MSI Claw ökar prestandan med upp till 150 procent14
- Testlabbet byter ut skärmarna – nioårig trotjänare pensioneras34
- Bahnhofs VD ratar stoppet mot fulstreaming47