Visual basic question ?
#1

if anyone here has a good knowledge of Visual basic i have this question

How can i open a file example "test.txt"
And lets say there is this in it
Код:
EXAMPLE
TEST
HOWYOUDOTHIS
VISUALBASIC
And i want to read only 1 line from that file
so lets say i want the line with HOWYOUDOTHIS
How can i do that ?

i got this but it read line after line
PHP код:
Dim reader As New System.IO.StreamReader(CurDir() & "\" & "test.txt")
Dim str1, str2, str3 As String
str1 = reader.ReadLine("
Mesegae1")
str2 = reader.ReadLine("
Mesegae2")
str3 = reader.ReadLine("
Mesegae3")
reader.Close()
Label5.Text = str1
Label6.Text = str2
Label7.Text = str3 
Reply
#2

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
if anyone here has a good knowledge of Visual basic i have this question

How can i open a file example "test.txt"
And lets say there is this in it
Код:
EXAMPLE
TEST
HOWYOUDOTHIS
VISUALBASIC
And i want to read only 1 line from that file
so lets say i want the line with HOWYOUDOTHIS
How can i do that ?

i got this but it read line after line
PHP код:
Dim reader As New System.IO.StreamReader(CurDir() & "\" & "test.txt")
Dim str1, str2, str3 As String
str1 = reader.ReadLine("
Mesegae1")
str2 = reader.ReadLine("
Mesegae2")
str3 = reader.ReadLine("
Mesegae3")
reader.Close()
Label5.Text = str1
Label6.Text = str2
Label7.Text = str3 
Success.
Reply
#3

well i did say i don't want to read it Line by Line
But tnx anyways
Reply
#4

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
well i did say i don't want to read it Line by Line
But tnx anyways
Just ****** vb.net ini class then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)