Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!!

X-Corp

Take a hit

  • *Experts*
Posted

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:
Posted

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!

X-Corp

Take a hit

Posted

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!

X-Corp

Take a hit

  • *Experts*
Posted

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:

Dim writer As New IO.StreamWriter("path to the file")

The you have to write the info to the file:

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.

:)

  • *Experts*
Posted
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.
Posted

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.

Posted

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.

X-Corp

Take a hit

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...