Results 1 to 8 of 8

Thread: [2008] Visual Basic 2008 INI READ/WRITE

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    3

    [2008] Visual Basic 2008 INI READ/WRITE

    Hi this my first time here.
    i'm a beginner in visual basic 2008.

    I want to make form when i open it read the ini and put the information in the textbox.
    Example:
    Start program: INI Read: Pickups=620
    textbox must say 620 when i change 620 to 455 and press on a bottom
    i saves 455 to the ini INI Saved: Pickup=455

    Can anybody help me?

    i'm from the netherlands Thanks for help!
    My english is not verywell

  2. #2
    Hyperactive Member .NetNinja's Avatar
    Join Date
    Oct 2008
    Location
    USA
    Posts
    281

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    Here is an article that explains how to do it using API calls:

    http://www.codeproject.com/KB/files/...ssIniFile.aspx

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    3

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    Quote Originally Posted by .NetNinja
    Here is an article that explains how to do it using API calls:

    http://www.codeproject.com/KB/files/...ssIniFile.aspx
    Yeah i see. but how to read the ini and put the readed value in a textbox?

    Thx

  4. #4
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    TextBox1.Text = variable that you read in from your ini
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  5. #5
    Hyperactive Member .NetNinja's Avatar
    Join Date
    Oct 2008
    Location
    USA
    Posts
    281

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    Everything you will need is given in the sample code download in the article I gave you.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    You should avoid using INI files at all if it's within your power. .NET apps have inbuilt support for XML config files. The simplest way to use one is to add values on the Settings tab of the project properties and then access them via My.Settings in code. You simply read and write like any other properties. All the loading and saving is done for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    3

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    I don't know what you mean...

    Where can i found a tutorial about it..?

  8. #8
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Visual Basic 2008 INI READ/WRITE

    in your IDE, click Project-->Properties-->Settings tab

    there you can add a new my.settings property.

    to use it:

    vb Code:
    1. my.settings.newPropertyName = "aString" ' or any value, set datatype accordingly
    2. my.settings.save

    then in your form_load event:

    vb Code:
    1. textbox1.text = my.settings.newPropertyName

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width