Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# read only file used by other app

using(FileStream logFileStream = new FileStream(@"c:	est.txt", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
    using(StreamReader logFileReader = new StreamReader(logFileStream))
    {
        string text = logFileReader.ReadToEnd();
        // Your code..
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #file #app
ADD COMMENT
Topic
Name
3+9 =