Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# streamwriter

// The StreamReader are using the Namespaces: System and system.IO

using (StreamWriter sw = new StreamWriter("c:WriteLines.txt")) //path
{
  sw.WriteLine("Here goes the text");

}
Comment

streamwriter c#

using System.IO;

StreamWriter out = new StreamWriter("file.txt");
out.WriteLine("First line.");
out.WriteLine("Second line.");
out.WriteLine("Third line.");
out.WriteLine("Fourth line.");
out.WriteLine("Fifth line.");
out.Close();

//This will create a txt file in the debug folder.
/*U can set the path by using*/ "c:path"
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# remove spaces from string 
Csharp :: c# for loop increment by 2 
Csharp :: convert int to short c# 
Csharp :: how to get key value from json object in c# 
Csharp :: how to spawn a object in unity 
Csharp :: c# array of strings 
Csharp :: odd or even in c# 
Csharp :: jarray to list c# 
Csharp :: how to pass class type to method c# 
Csharp :: tostring tmpro unity 
Csharp :: get folders in directory c# 
Csharp :: how to change color of a sprite in unity 
Csharp :: No context type was found in the assembly 
Csharp :: how to make an object appear and disappear in unity 
Csharp :: add rotation unity c# 
Csharp :: make window not resizable wpf 
Csharp :: wpf richtextbox clear text 
Csharp :: unity transparent object 
Csharp :: c# check if string is all numbers 
Csharp :: c# file directory selection 
Csharp :: unity RemoveComponent 
Csharp :: how to get the hour on c# 
Csharp :: add item to list c# 
Csharp :: disable rigidbody unity 
Csharp :: c# get array subarray 
Csharp :: unity instantiate prefab rotation 
Csharp :: list index out of range c# 
Csharp :: c# loop through list of objects 
Csharp :: npm install --save vue-route@n 
Csharp :: wpf app how to get all elements 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =