Solved

Read a file with visual basic .net 2.0

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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)…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now