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 Efter konkursryktena – Louqe är tillbaka 13
- Igår Kunskapsquiz: IT och det moderna försvaret 40
- 17 / 4 Datorhallar åker på miljardstor skattesmäll – ljög om att utvinna krypto 53
- 17 / 4 Veckans fråga: Möss eller ljud – Vad lägger du mest pengar på? 73
- 16 / 4 X kan råda bot på bottar med betallösning 33
- Vilken alkoholhaltig dryck dricker ni just nu?5684
- Dagens fynd (bara tips, ingen diskussion) — Läs första inlägget först!18384
- Vad vill ni se i nästa Battlefield?75
- Wordle på svenska - ordlig.se7826
- Pny 4070 ti super omdömen17
- Har Microsoft blockad nätverket?3
- Bästa grafikkortsköpet i april 2024165
- Snart ber Microsoft dig överge ditt lokala konto97
- Temu.com73
- Fick varning i F-secure om Trojan.TR/Crypt.ZPACK.Gen2 efter att ha uppdaterat mitt Steam bibliotek, bland annat cs2 go3
- Säljes 12700k | 980 PRO 1tb | Contact Frame TG
- Köpes Söker Dongle till Steelseries Arctis 7X PLUS
- Säljes Diverse PS5-spel, Ritplatta och Motorola Moto G 5g plus!
- Säljes RTX 3050 8 GB ROG STRIX GAMING OC
- Säljes Sennheiser HD560S och RÖDE NT-USB
- Säljes Mp600 Pro 2TB, hel dator gtx 1080,6700k, ryzen 3600 samt gtx 1070
- Säljes AOC AGON PRO PD32M - 32" 4K IPS MiniLED 144 Hz
- Säljes ASUS Z170-A inklusive CPU i7-6700 och kylare "be quiet! Pure Rock"
- Säljes Inno3D 4070 Super
- Säljes Herman Miller Embody + Atlas headrest
- Edge kan få klassisk sci-fi-funktion7
- Efter konkursryktena – Louqe är tillbaka13
- Snart ber Microsoft dig överge ditt lokala konto97
- Kunskapsquiz: IT och det moderna försvaret40
- Här är priserna på LG:s nya OLED-arsenal46
- 3dfx grafikkort återuppstår i hobbyprojekt16
- Logitech släpper ”AI-knapp” – snabbgenväg till Chat GPT11
- Här är systemkraven för Ghost of Tsushima till PC30
- Välj rätt TV för ljusa rummet13
- Bli ett RGB-Pro med Razers nya musmatta för 1 100 kronor18
Externa nyheter
Spelnyheter från FZ
- Kingdom Come: Deliverance II igår
- Todd Howard: "Väldigt bra" Starfield-uppdateringar väntar runt hörnet igår
- No Rest for the Wicked släpps strax i early access igår
- Diskutera – De värsta logiska vurporna du (tyvärr) sprungit på i spel igår
- World of Warcraft på konsol? Blizzard: "Ingenting är omöjligt" igår