コード例 #1
0
 public void ReadFile_With_OpenRead()
 {
     using (var stream = _file.OpenRead(_EXAMPLE_FILE_PATH))
         using (var reader = _factory.CreateReader(stream))
         {
             var content = reader.ReadToEnd();
             Console.WriteLine("[ViaFile.ReadFile_With_OpenRead] File content: " + content);
         }
 }
コード例 #2
0
ファイル: ViaFileInfo.cs プロジェクト: PawelGerr/Tooling.Test
        public void ReadFile_With_OpenRead()
        {
            IFileInfo fileInfo = _factory.CreateFileInfo(_EXAMPLE_FILE_PATH);

            using (IFileStream stream = fileInfo.OpenRead())
                using (IStreamReader reader = _factory.CreateReader(stream))
                {
                    string content = reader.ReadToEnd();
                    Console.WriteLine("[ViaFileInfo.ReadFile_With_OpenRead] File content: " + content);
                }
        }