By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

read a line from a text file

P: 30
i need to read line 2 of a text file but not line 1
here is what i tryed
Expand|Select|Wrap|Line Numbers
  1. Dim MyTime = Format(Now, "dd-MMM-yyyy")
  2. Dim phillstatus As String
  3. Dim phillcount As String
  4. Dim phillreader As String
  5. phillreader = My.Computer.FileSystem.ReadAllText("C:\Users\Richard\Documents\test.txt")
  6. phillcount = phillreader.ReadLine(1)
Dec 13 '07 #1
Share this Question
Share on Google+
6 Replies


Expert 5K+
P: 8,434
...here is what i tryed...
Dyd it work?
Dec 13 '07 #2

P: 30
Dyd it work?
no so i change the code to

phillreader = My.Computer.FileSystem.ReadAllText("H:\VB\phill count.txt")
phillcount = phillreader(1)
TextBox1.Text = phillcount

this and it will only read that chatcher number
Dec 13 '07 #3

Expert 5K+
P: 8,434
Two questions...
  1. Is there any difference, apart from the fact that you're putting the output in a textbox?
  2. What does the word "chatcher" mean?
Dec 13 '07 #4

P: 30
what ever nuber i put i get that letter of the file
Dec 13 '07 #5

P: 30
i need the hole lin in 2 seperate things
Dec 13 '07 #6

debasisdas
Expert 5K+
P: 8,127
What are "nuber" , "hole" , "lin"

This is not a chatting forum . Please post your questions clearly.
Dec 13 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.