Solved

Read a file with visual basic .net 2.0

Posted on 2013-01-02
1
304 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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