Code Snippet posted by:
Lakhangarg | Posted on: 9/8/2009 | Category:
C# Codes | Views: 755 | Status:
[Member] [Moderator]
|
Alert Moderator
using System.IO;
Random objRandom = new Random();
string SourceFilePath=Server.MapPath("TextFile.txt");
string DestinationFilePath=Server.MapPath(".").ToString()+objRandom.Next().ToString()+".txt";
File.Copy(SourceFilePath, DestinationFilePath);
Random objRandom = new Random();
objRandom.Next()
This class is used to Create Random Number
each time this will return a unique number.
Use File.Copy to Copy the Content of one file to other and save the new file.