Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have the .ini reader from mentallis.org, but is there a .vb file that reads and writes using .cfg files? Also, it would need to write like this:

 

Save File "True"

Save Logs "False"

 

Instead of:

Save File=True

Save Logs=False

 

If you know how to do so, please help. :(

It's not impossible, it's Inevitable.
Posted
What is to stop you from writing your own? Parsing the lines in your .cfg file should be easy using regex.

 

 

Can you tell me a little more about this?

It's not impossible, it's Inevitable.
Posted

I'll do it like this instead....How can I make the "" go around the TextBox51.Text?

 

Dim StreamWriter As New IO.StreamWriter("serv config.cfg")

StreamWriter.Write("set sv_serverip" & " & TextBox51.Text & ")

StreamWriter.Close()

 

 

I need it to write like this with the quotations:

''''Textbox51.text = 12.34.56.78....

 

set sv_serverip "12.34.56.78"

It's not impossible, it's Inevitable.
Posted

I need it to write like this with the quotations:

 

You can generally write however you like, but to write double quotes, I think you need to use the asci keycode or the .net/vb keycode (which is probobly just a wrapped asci keycode).

 

I've never really seen the huge todo about needing special methods of reading/writing input, unless you're going to share it with another program.

 

Personally I use XML becuase it's the easiest, but I've used plain text and just thought up a method on the fly for writing/reading. You just need to figure a way to seperate what is the "Name" of the property, and what is the data within.

 

In your case, it's the text on a line up to the quotation mark that is telling the program what the setting is, then after the quote and until the next one is the setting.

 

It's really easy to create a class to read/write in this fashion and keep it generic enough to use in all your apps.

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