DJ MC
2009-01-19 15:46:34 UTC
Hi,
ive been trolling google for a while now and cannot find my answer so
im hoping someone can help me. Ive had previous experience with VBA in
excel and made a couple of programs, im now given the task of
understanding visual studio 2005 and creating a program with this
software. i feel my knowledge of VB .net is next to none as whatever i
type just isnt working :(
Anyways...i have a form with 13 textboxes already populated, what i
need to do is whenever the form is loaded it opens a .ini file and
reads the lines and populates each textbox accordingly, this is
my .ini file:
[Textbox Values]
Frm01=Textbox1value
Frm02=Textbox2value
Frm03=Textbox3value
Frm04=Textbox4value
Frm05=Textbox5value
Frm06=Textbox6value
Frm07=Textbox7value
Frm08=Textbox8value
Frm09=Textbox9value
Frm10=Textbox10value
Frm11=Textbox11value
Frm12=Textbox12value
Frm14=Textbox14value
I got this piece of code from a microsoft site to start me off, im not
sure if this is the best way to go but this should open the ini and
read the lines in the file.
Dim objStreamReader As StreamReader
Dim StrLine As String
Do While Not StrLine Is Nothing
objStreamReader = New StreamReader("C:\SubContratorXML
\Textboxes.ini")
StrLine = objStreamReader.ReadLine
Loop
From this point im stuck on how i would be able to read the string
after the "=" and then populate it into the correct textbox. any help
would be much appreciated.
Thanks
ive been trolling google for a while now and cannot find my answer so
im hoping someone can help me. Ive had previous experience with VBA in
excel and made a couple of programs, im now given the task of
understanding visual studio 2005 and creating a program with this
software. i feel my knowledge of VB .net is next to none as whatever i
type just isnt working :(
Anyways...i have a form with 13 textboxes already populated, what i
need to do is whenever the form is loaded it opens a .ini file and
reads the lines and populates each textbox accordingly, this is
my .ini file:
[Textbox Values]
Frm01=Textbox1value
Frm02=Textbox2value
Frm03=Textbox3value
Frm04=Textbox4value
Frm05=Textbox5value
Frm06=Textbox6value
Frm07=Textbox7value
Frm08=Textbox8value
Frm09=Textbox9value
Frm10=Textbox10value
Frm11=Textbox11value
Frm12=Textbox12value
Frm14=Textbox14value
I got this piece of code from a microsoft site to start me off, im not
sure if this is the best way to go but this should open the ini and
read the lines in the file.
Dim objStreamReader As StreamReader
Dim StrLine As String
Do While Not StrLine Is Nothing
objStreamReader = New StreamReader("C:\SubContratorXML
\Textboxes.ini")
StrLine = objStreamReader.ReadLine
Loop
From this point im stuck on how i would be able to read the string
after the "=" and then populate it into the correct textbox. any help
would be much appreciated.
Thanks