3 Replies - 8731 Views - Last Post: 21 March 2010 - 06:14 AM Rate Topic: -----

#1 eak2k  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 19-January 09

[VS 2008] Save to Config.ini file

Posted 21 March 2010 - 05:50 AM

Hi!

I'm using this code:
 Dim tfLines() As String = System.IO.File.ReadAllLines("Config.ini")
                For Each line As String In tfLines
                        Dim arr As String() = line.Split("="c)
                        If arr(0) = "title" Then textbox1.text = arr(1)
                Next



To read from a config file that looks like this this:

Quote

title=this is the text


Now is the question, how can I save to the config file?
Like, replace "this is the text" with the new text in textbox1.text

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: [VS 2008] Save to Config.ini file

#2 Luc001  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: [VS 2008] Save to Config.ini file

Posted 21 March 2010 - 06:10 AM

Hi,

If you mean that when you changed the text into a textbox and the next time you open your application, the changed text still be shown into the textbox then you need to use My.settings...

You can find some explanation here.
Was This Post Helpful? 0
  • +
  • -

#3 eak2k  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 19-January 09

Re: [VS 2008] Save to Config.ini file

Posted 21 March 2010 - 06:11 AM

I don't want to use My.Settings, I already know about it.

I want to use Config.Ini file...
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2263
  • View blog
  • Posts: 9,469
  • Joined: 29-May 08

Re: [VS 2008] Save to Config.ini file

Posted 21 March 2010 - 06:14 AM

You may want to try out my codeplex project: Project Wife it was to make handling ini files simple.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1