Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- namespace ConsoleApp1
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string writeText = "Learning C#";
- //writing on file
- File.WriteAllText("filename.txt",writeText);
- //path of file
- //root_project_location vary where you save the project folder
- string path = @"[ROOT_PROJECT_LOCALION]\bin\Debug\filename.txt";
- string readText = File.ReadAllText(path);
- Console.WriteLine(readText);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement