Great stuff, thanks a lot! Thumb is up and channel subscribed Allow me to ask: How to prevent users from simply reading the db file and get all the usernames and passwords? I mean sqlite dbs are mainly for local use, or am i wrong?
Hi welcome, check out this video ( ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZbUCgU3G1z4.html ) were I explain how to encrypt passwords before storing them to a database, this resolves the problem you just mentioned
Best practice is to prepend a 6-8 random salt to the password, then hash it to MD5. When writing your the DB, only the salt and hashed password are stored. Now, when the using enters his/her password, the salt is taken from the database and prepended to the password which is once again hashed to MD5. If both hashes match, let the user in. This way the actual password is never stored in the database
You can write an extra constructor on the MainWindow class to take in a parameter which in this case is the user, then every time you login successfully and want to open the main window you can pass that object through the constructor. The other way is you can create a static instance of the user class that you can access throughout the application
Yes you can save it to variable however in this case the user the ID is auto generated by the database this is because we set the ID property to a primary key this prevents duplicates,however you can define your own user ID but just make sure they’re all different you can use a hashing function to do that ,
@@TacticDevs I want to save it so a variable so that it acts as a foreign key in another table, in order to do that I need to save the user ID with the input
try using a the (DB Browser for SQLite) software to verify if the user is in the database , also make sure the save changes method called each time you add a user this will ensure the user is saved
The Onstartup method has to be overridden , you can type override in the App.xaml.cs class it will show up some suggestions of methods, check this part of the video 9:14
@@TacticDevs for me it is 'MainWindow.xaml.cs' class, I did some research and think the OnStartUp method is only supported by 4.0 framework, but I changed from the 4.0 framework to the 5.0 because one of the nuget packages doesn't support 4.0 framework, suggestions?
@@tristy7364 I used .net5 for this project ,the OnStartUp method is still supported(shorturl.at/lsuT0) it is part of the App or Application Class which mean you can only override it inside the App class (App.xaml.cs) not MainWindow , in your project there is a file named App.xaml click the expander next to it, it will reveal the (App.xaml.cs) file open that file to add the OnStartup Method
So i really want to make when i have added the user to the database when he login one time he doesn't have to login again "only one time window" i mean
No I did not install any libraryThe main page is a “window class” the window class has a method called show,make sure you’re calling the method on the right object(windows object ) And you need to create an instance before you can call the show method
@@zergzerg4844 Before you can use the method you need to create an instance (new object )of the window class. Example “MainWindow mywindow = new MainWindow()" then “mywindow.Show();”
can someone pls help me? at 14:09 i get an error when doing "var Password = PasswordText.Password;" it says 'Textbox' does not contain a definition of 'Password'
@@veloxdev In the UI there are two textbox controls defined one is for the username and the other one is for the password,just be sure that the text box for the password is a (password textbox), The reason it’s giving you the error is probably because you are using a normal textbox instead of a password textbox. WPF has two types of textbox ,(Textbox)and (PasswordTextBox)
it's not ideal to display user names and passwords in a drop-down list for security reasons however you can cache previously entered information this can be done by storing the usernames to a json file I will make a tutorial on how to do it
You use the data context property to pass the the user object to the ui , Once the object is available in the UI you can then simply bind the text property to the username and password, WPF will automatically bind to the password and username because you passed the object using the data context property which is found on the window that is holding the Ui