![]() |
|
[.NET] [VB.NET][MySQL]Login + Register Class - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [VB.NET][MySQL]Login + Register Class (/showthread.php?tid=154394) |
[VB.NET][MySQL]Login + Register Class - The-One - Sep 25, 2009 New thread (classed): https://hackforums.net/showthread.php?tid=1376434
Some people askes, if there's a register system belonging to some Login Systems, so I wrote a little Class which allows you to do that. Current Solutions For Error's Ok, if u have some error's with (anytype of this) " MySql.Data.MySqlClient" Then download the MySql.Data.dll(At Requirements) OR [ Download ] Then add it into your project : Project > Add Existing Item > Filter so you can select a .DLL > Navigate to MySql.Data.dll > Add It , Now the most errors should be gone! Got still error's? Download the source below the thread.(U can mod it if u want.) Introducing This is a VB.NET Class, which allows your users to register an account, which gets saved on a MySQL Database online, so they can login everywhere. It includes MD5 hashing of your password and usernames to increase the securtity. Requirements
Getting Started At first you need to create the needed databases. Use this as SQL command. Go to your PHPMyAdmin, select your database and click on SQL. ( Look here ) Add this: Code DROP TABLE IF EXISTS `users`;Then add the MD5 Module to your project: ( Credits go to: http://dotnet-snippets.de ) Code Imports System.Security.CryptographyThen the Registering class RegSys.vb: Code Imports MySql.Data.MySqlClientThe rest is quite easy, you just need to set the connection from the class and reference the textboxes. The register Form should look like this: [img]http://www.abload.de/img/scrn_reg_form7lr2.png[/img] The code for registering is: Code Dim myRegSys As New RegSysPut this into the Button Sub! On SetConnectionData replace 12.345.678.910 with your Server ip! Username and password are replaced with your database username and password and database is the database where you created the table. Also replace the textboxes with the names of yours. (TextBox1 = username, TextBox2 = password, TextBox3 = Retyped password) The Login Form should look like this: [img]http://www.abload.de/img/scrn_login_form9b5m.png[/img] The code for logging in is: ( Nearly the same ) Code Dim myRegSys As New RegSysSetConnectionData will be the same like registering. Also the TextBoxes. (TextBox1 = username, TextBox2 = password) If anything is unclear, look at the comments in the class or ask here :) Download Source http://www.mediafire.com/download.php?zvqynz4zo5r * - Saitek192 - Sep 25, 2009 Thank you. I will try it Can you give me download for source code ? Lol it works thank you very much * - BlueMelon - Sep 25, 2009 Very nice tut man Thanks! * - MAD-DOG - Sep 25, 2009 i have been looking for this thank you so much... * - an087535 - Sep 25, 2009 can you give the source code/project of this please. * - MAD-DOG - Sep 25, 2009 can one tell me how can i fix this? http://img7.imageshack.us/img7/7590/posting1i.jpg * - Saitek192 - Sep 26, 2009 Import into project Mysql.Data from .NET tab * - MAD-DOG - Sep 26, 2009 i did that.!!!!!!!!!!!!!! * - Saitek192 - Sep 26, 2009 so ignore it, it does not mean anything, I got it too * - MAD-DOG - Sep 26, 2009 do i have to edit this code? Quote: Public Function SetConnectionData(ByVal ip As String, ByVal username As String, ByVal pw As String, ByVal database As String) * - The-One - Sep 26, 2009 No there are just warnings, they wont infect your program. * - MAD-DOG - Sep 26, 2009 i think they did buc when i click on login or Register i get this error " no connection to the database! " * - Saitek192 - Sep 26, 2009 OMG , hey , The-One i need help with this : i want to see in textbox5.text infromation from table in mysql it is possible ? * - MAD-DOG - Sep 26, 2009 why am i getting this ever time i try to login or Register can some one please help me??!!??!!?? [img]http://img22.imageshack.us/img22/7470/posting1.jpg[/img] * - The-One - Sep 26, 2009 I dont know sure, but i ALWAYS use database from db4free.net try using that database... |