Solved

Read a file with visual basic .net 2.0

Posted on 2013-01-02
1
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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