Solved

Read a file with visual basic .net 2.0

Posted on 2013-01-02
1
303 Views
Last Modified: 2013-01-06
Useing:
System.IO.File.ReadAllText(filename)

Does this lock the files it's reading?  Could I have mutiple applications all using this line and be able to read the file at the same time?

This is also a log file that does get written to, just not very often.  Can I still read the file if it's being appended to?
0
Comment
Question by:chadmanvb
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38738263
Description of this function on MSDN is

Opens a text file, reads all lines of the file into a string, and then closes the file.

http://msdn.microsoft.com/en-us/library/system.io.file.readalltext.aspx


If you want to read a locked file, try following

http://stackoverflow.com/questions/1389155/easiest-way-to-read-text-file-which-is-locked-by-another-application
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question