Advertisement
nahidjamalli

Lesson #14

Apr 26th, 2020
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace CSharpConsoleApp
  5. {
  6.     class MyClass
  7.     {
  8.         static void Main()
  9.         {
  10.             string fileName = "text.txt"; // faylın adı
  11.             StreamReader reader = new StreamReader(fileName); // axın yaradılır
  12.  
  13.             string melumat = reader.ReadToEnd(); // bütün faylı oxunur
  14.  
  15.             reader.Close(); // axın bağlanılır.
  16.  
  17.             Console.WriteLine(melumat); // Console-a yazdılır
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement