How to

create text file

Published: 22. December 2008 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: File system » Files, Streams
Tags: C# File System
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at

Import namespace

using System.IO;


string path = Path.GetTempFileName();

StreamWriter streamWriter = File.CreateText(path);

streamWriter.Write("this is temp text file");

Send us feedback about this snippet »

Related Snippets: