{IP}Gil-Galad
Member
- Joined
- Sep 25, 2005
- Messages
- 19
- Programming Experience
- Beginner
well im working on a program that you can open a file, i searches through it for lines that begin in a word, stores that whole line as a variable, then the variables are stored in a combo box this is what i got so far.
it should read the file that i just selected. the problem is im a newbie so i need help what comes next.
Heres an example file.
these lines (Armor cojrec, Armor rv) i want each stored to a variable so i can use that to add the lines above into a combo box.
I need this asap i no im asking alot but theres no other way around this.
any help would be deeply appreciated thank you
VB.NET:
[color=#0000ff]Private[/color] [color=#0000ff]Sub[/color] btnArmor_Click([color=#0000ff]ByVal[/color] sender [color=#0000ff]As[/color] System.Object, [color=#0000ff]ByVal[/color] e [color=#0000ff]As[/color] System.EventArgs) [color=#0000ff]Handles[/color] btnArmor.Click
[color=#0000ff]With[/color] OpenFileDialog1
.Filter = "All Files (*.*)|*.*|" & _
"INI Files (*.ini)|*.ini"
.FilterIndex = 1
.Title = "Open Armor.ini"
.CheckFileExists() = [color=#0000ff]True
[/color]
.CheckPathExists = [color=#0000ff]True
[/color]
.ValidateNames = [color=#0000ff]True
[/color]
.DereferenceLinks = [color=#0000ff]True
[/color]
.InitialDirectory = "c:\"
.ShowDialog([color=#0000ff]Me[/color])
[color=#0000ff]If[/color] .FileName <> "" [color=#0000ff]Then[/color][color=#008000]
[/color][color=#0000ff]Dim[/color] sr [color=#0000ff]As[/color] IO.StreamReader = IO.File.OpenText(.FileName)
[color=#0000ff]
[/color]
[color=#0000ff]End[/color] [color=#0000ff]If
[/color]
[color=#0000ff]End[/color] [color=#0000ff]With
[/color]
[color=#0000ff]End[/color] [color=#0000ff]Sub[/color]
it should read the file that i just selected. the problem is im a newbie so i need help what comes next.
Heres an example file.
hwufg
Armor cojrec
ihoivre
Armor rv
these lines (Armor cojrec, Armor rv) i want each stored to a variable so i can use that to add the lines above into a combo box.
I need this asap i no im asking alot but theres no other way around this.
any help would be deeply appreciated thank you