Saving Information??

xcorp

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

I have a small problem. I'm a bit of a newb to Visual Basic and still havn't really got the jist of the language.

Anywho, I've been fooling around with programs of all different sorts and havn't 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.

I've been asking them for a long time but they're used to about 10 or 15 different languages. They're old dos people.

I havn't been able to figure out how to save data in Visual Basic.
If you still havn't totally understood my question I'll 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 we're currently playing.

How would I save that? I'd 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 can't figure out how to do this...


Although I'm no dumbass, I'm 13 years old, so please... Don't go into sockets and the such - It's all greek to me.

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

Although I'm no dumbass, I'm 13 years old, so please... Don't go into sockets and the such - It's 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

It's 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 I'm not entirly sure - I just wanna save a bit of imformation. about a user.

It's 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.

Wouldn't 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:I'm 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:
Visual Basic:
Dim writer As New IO.StreamWriter("path to the file")
The you have to write the info to the file:
Visual Basic:
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 don't 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.

I'm gonna try it.

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