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#.

Recommended Answers

You could use a for-loop like this:
[CODE=C#]for (int i = 0; i < NumOfFiles; i++)
{
Filname = "Myfilename" + i.ToString();
// other code here
}[/CODE]

Jump to Post

All 2 Replies

You could use a for-loop like this:

for (int i = 0; i < NumOfFiles; i++)
            {
                Filname = "Myfilename" + i.ToString();
                // other code here
            }

Thank you so much ddanbe for your solution