Random file name

In this chapter you will learn:

  1. Get Random File Name

Generate random file name

using System;//from   j a v  a2 s .co m
using System.IO;

class MainClass
{
    public static void Main() 
    {

        Console.WriteLine( Path.GetRandomFileName() );
    }
}

The code above generates the following result.

Next chapter...

What you will learn in the next chapter:

  1. How to create temporary file
Home » C# Tutorial » File, Path
File creation
Deleting Files
Put to recycle bin
File Exists
File moving
File size
File attribute
Set file attribute
File time change
File time
Random file name
Temporary file
Path
Directory creation
Delete directory
Path existance
Change the path
Current Path
Directory listing
Recursive Path Listing
Combine path
Calculate Directory Size
Invalid path characters
System path
Directory copy
Drive
Drive information
File access rule
File System watcher