create files in numbered sequence in c#

September 5, 2011 at 17:14:11
Specs: Windows 7
Hi i need to create about 100 files in a numbered sequence like :
file1.txt,file2.txt,file3.txt .
so how can i create these files using c#.

See More: create files in numbered sequence in c#

Report •

#1
September 22, 2011 at 01:36:22
Hi,

Here is the loop I would use to create empty text files in C#

for(int i=0; i < 100; i++)
{
string filename = "File" + i.ToString() + ".txt";

File.Create(filename);

}


Report •
Related Solutions


Ask Question