Sequential file question
A the moment I've got my program reading text from a text file, which is great. The text file holds just 11 numbers (eg 11211215665), what I'd like to do is have it read the 11 numbers and take the last 4 digits (5665) to store as an int or something. Does anyone have any clue how I could go about this?
here's the code Im using to read the file, it reads fine it seems. what do you think of it?
Dim seqInfo As New System.IO.StreamReader("C:\log.txt")
txtDisplay.Text = seqInfo.ReadToEnd()
seqInfo.Close()
thank,
Sar
[590 byte] By [
SarH] at [2007-11-20 6:19:09]

# 1 Re: Sequential file question
Hi,
One possible approach;
Dim myString As String
Dim myInt As Int32
myString = txtDisplay.ToString()
myString = myString.Substring(myString.Length - 4)
myInt = Convert.ToInt32(myString)
Hope this helps!
Regards,
Laitinen
# 2 Re: Sequential file question
Oh wow thanks :)
I've been looking at subStrings but havent managed to get mine working, thanks.
SarH at 2007-11-10 3:11:16 >
