Saving Information??

xcorp

Active member
Joined
Jul 10, 2003
Messages
35
Location
bc canada
Hey guys.

I have a small problem. Im a bit of a newb to Visual Basic and still havnt really got the jist of the language.

Anywho, Ive been fooling around with programs of all different sorts and havnt been able to figure out how to save data.

For instance... My parents, who are very successfull programmers and make Payroll programs for a living. Of course in creating these programs your going to have to save the data for the user.

Ive been asking them for a long time but theyre used to about 10 or 15 different languages. Theyre old dos people.

I havnt been able to figure out how to save data in Visual Basic.
If you still havnt totally understood my question Ill lay out an example.

For instance I was thinking of creating a "Clan Oraniser" program for games like Counter-Strike. It would come in handy in handling your members, and important information such as "Wonid" wich enables them administrator access to our "Server" or map were currently playing.

How would I save that? Id need to save "Name, Location, Email, Wonid" and a bunch of other essencial information. I think it would envolve creating a text file such as.. "info.txt" or somethen like that...

I cant figure out how to do this...


Although Im no dumbass, Im 13 years old, so please... Dont go into sockets and the such - Its all greek to me.

Any help would be appriciated!!
 
Look into using databases. Look for your MSDN for information about using ADO.NET.

Although Im no dumbass, Im 13 years old, so please... Dont go into sockets and the such - Its all greek to me.
Age and skill/ability to learn are completely unrelated. :rolleyes:
 
lol Thanks...

And I know about the ability to learn stuff. lol

Its just most of the "Senior Contributor" people are adults and understand the complicated words. lol....

I meant to "Take it easy"

Thanks Volteface!
 
Umm...


Well Im not entirly sure - I just wanna save a bit of imformation. about a user.

Its it possible to write a text file and then open it when u want..?
and say how it interrpertes the information in the textfile like..


boy101:bc canada:24829348

So thats his name, location and special id number for a game.

Wouldnt I be able to call up that imformation later?

Your the pro, I dunno anything!

I really dont know much to tell you the truth.. Sorry!
 
is it a lot of date?
if yes, registry is out of the question,
Then maby xml, personaly i find it had,
So mabey access is what you need.

btw:Im only 15, and still lot to learn so i could be wrong :s
 
You dont really need a database for that.
To write to a file you need to use the IO.StreamWriter class.
Declare a new instance of it and pass in the path at which the file will be saved:
Code:
Dim writer As New IO.StreamWriter("path to the file")
The you have to write the info to the file:
Code:
writer.Write(username & ":" & location & ":" & userid)
writer.Flush() make sure everything was written
writer.Close() close the stream
substitute the names of the variables with the ones you actually use.
:)
 
Dump question what happen wehn you dont flush?
Never done it and it works, alslong as i close it.
 
Flush causes the buffers of the stream to clear and writes them to the file, this ensures everything you wanted to write to the file is actually written. Close does that and also begins the the disposing for the stream.
 
You might have stuff floating around :-).
Flush() just make sure that all buffered data completely out of buffer which kinda make sure you get all the thing that you intended to write to your stream.
 
Thanks alot guys.

I think I"m slowly undestanding what mutant said about OI. things.

Im gonna try it.

Thanks and Ill post another message in this thread if I have any problems.
 
Back
Top