Sponsored Ad

Sunday, March 13, 2011

How to Generate Random Filename and Extension using C#

The below program will help you to generate random file names and random extensions for those files. C# provide GetRandomFileName function to achieve the same.

How to Generate Random Filename and Extension using C#

C# Example code to generate randome file name:

using System;
using System.IO;
namespace MyApp
{
    class Extension_class
    {
        static void Main()
        {
            string my_random_file = Path.GetRandomFileName();

            Console.WriteLine(my_random_file);

            Console.Read();
        }
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates