-
I have a vb application that will go out and read a log\txt file sitting on a remote server. The file size is approximately 500 bytes so it is relatively small. The problem I am having is that it can take in upwards of 1 minute to read line by line of the file and return it back to a vb window on the client. My question is how can I speed this process up. Here is my code below:
CommonDialog.FileName = "\\<unc file path>\log.txt"
Open CommonDialog.FileName For Input As #1
Do Until EOF(1)
Line Input #1, LineOfText$
AllText$ = AllText$ & LineOfText$ & Wrap$
Loop
txtLog.Text = AllText$
Any suggestions would be greatly appreciated!
-
Can't you make a copy of the file, save it in the windows temp folder locally and read it from there instead ?
-
Read the data into an array and do the string manipulation after you have closed the file, also you may want to use INPUT# since this reads a line at a time into a variable instead of a character at a time (as LINE INPUT does)
Cheers,
Paul.
-
Open the file for binary, it's much faster... check out the File tutorial on kedaman's hp (www.kedaman.com), it helped me alot!