CSharp examples for File IO:File
Get a Random File Name
using System;/*from w w w.ja v a2s. co m*/ using System.IO; static class MainClass { static void Main() { string tempFile = Path.GetRandomFileName(); Console.WriteLine("Using " + tempFile); using (FileStream fs = new FileStream(tempFile, FileMode.OpenOrCreate)) { // (Write some data.) } // Now delete the file. File.Delete(tempFile); } }