• Congratulations to the Class of 2024 on your results!
    Let us know how you went here
    Got a question about your uni preferences? Ask us here

log in (1 Viewer)

cooldods

New Member
Joined
Nov 20, 2006
Messages
13
Location
Sydney
Gender
Male
HSC
2007
hey im making a maths tutor/practise program for my major work, (vb 2005 express edition) and i'd like to let the user 'log in' pretty much just to be able keep a record of and view their results, i think im ok writing to the database, but would anyone know how to set up an initial 'log in' type screen just so they can access. if anyone could show me how they do this or send me a copy of a program that does a similar thing i'd be rlly grateful
 

Winston

Active Member
Joined
Aug 30, 2002
Messages
6,128
Gender
Undisclosed
HSC
2003
This is your assignment, so i'm not going to write any code for you, but give you some giveaway tips.

Unless you're going to be storing a lot inside the DB, there's probably not much of a use to have a DB just to store it there, and besides it's just a mini project, so keep it simple.

In the end you would probably select Access as the backend, otherwise you might choose MySQL or SQL Server, which you may require the user to install the desktop engine.

Anyways, i suggest that you simply use an XML document to store a collection of user profiles.

What you would do is have a class called User, and have the necessary properties like Name, Password, etc...

Make sure you mark this class as Serializable by applying the Serializable attribute, i.e. <Seriablizable()> Public Class User..... End Class

And all you do is store a List<User> of User objects.

To load and save the user objects you would simply use the XmlSerializer class and invoke the Serialize and Deserialize methods to save and load respectively.

Basically everytime your Sub Main or your main forms InitializeComponent is called you can stick the code which Deserializes the XML document and get your List of Users back, and have that as a global Object.

Then you can instantiate and display the Login form, and implement the Login Button, which just does a look up of the username in the List of User objects, and checks the password.

It's not rocket science, pretty simple.

Hope that helps.
 
Last edited:

ianc

physics is phun!
Joined
Nov 7, 2005
Messages
618
Location
on the train commuting to/from UNSW...
Gender
Male
HSC
2006
my only word of warning is that last year we had no end of trouble using databases with visual basic because of the security policies on all the computers......so what works at home may not necessarily work at school
 

garabed

New Member
Joined
Jun 18, 2007
Messages
2
Gender
Male
HSC
2008
Lol, Im doing a Maths Game For SDD and mines quite Complicated..
I used a Text file to place the usernames in..
since its your assignment, I can't Really give you that much info, but theres one thing I can..

If you Are using a Txt file then you must:
Create a certain area where the user inserts username,
then the program must open the txt file,
Search for the username,
If the username isnt in the file then add it in..

Hope this Helps


-=ArmenianUnit=-
 

bboundy

New Member
Joined
Oct 25, 2006
Messages
29
Gender
Male
HSC
2007
wow. I feel pretty lucky. We got to learn PHP and MYSQL (one guy did Ruby on Rails). No compatability issues there and there are heaps of forums and sites you can goto if something makes no sense.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top