[HELP] Read text file in vc++ 2005

This is a discussion on [HELP] Read text file in vc++ 2005 within the C++ Programming forums, part of the General Programming Boards category; Im newbie here first let me say hello to all members of our forum I'm not a programmer . I ...

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    1

    [HELP] Read text file in vc++ 2005

    Im newbie here first let me say hello to all members of our forum

    I'm not a programmer . I only know little about vb6 by reading some ebook and source code .

    Now i want to do it in vc++ 2005 . But it really is diff than vb6 .

    I have some question here about read text file . I hope you will help me .

    Code:
    if (System::IO::File::Exists("settings.ini"))
    		{
    				System::IO::StreamReader^ sr = gcnew System::IO::StreamReader(System::IO::File::OpenRead("settings.ini"));
    				System::String^ text = sr->ReadToEnd();
    				this->textBox1->Text = text;
    				sr->Close();
    i have settings.ini file
    hp=0.2
    mp=0.2
    stm=0.2
    i read settings.ini and write to text .

    I have 3 combobox in Form1 . I want to read first Value (0.2) to combo1 next one to combo2 and last one to combo3 at form load event .
    in vb6 only some line of code i can do this
    Code:
    If Left(text, 2) = "hp" Then
                Combo1.Text = Mid(a, 4, 1)
            ElseIf Left(text, 2) = "mp" Then
                Combo1.Text = Mid(a, 4, 1)
            ElseIf Left(text, 3) = "stm" Then
                Combo1.Text = Mid(a, 5, 1)
            End If
    but i dont know how can i do this in vc++ 2005

    I hope you can help me . Thank you very much

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,893
    I am afraid that you have to start by learning C++, otherwise the only thing we can do is to provide you the answers on a golden platter.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  2. How to read chars from a text file and use them in TChart
    By Bachatero in forum C++ Programming
    Replies: 1
    Last Post: 08-29-2006, 04:03 PM
  3. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  4. getline function to read 1 line from a text file
    By kes103 in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:21 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21