954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Create Files In Numbered Sequence In C#

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

shandoosheri
Light Poster
42 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

You could use a for-loop like this:

for (int i = 0; i < NumOfFiles; i++)
            {
                Filname = "Myfilename" + i.ToString();
                // other code here
            }
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

Thank you so much ddanbe for your solution

shandoosheri
Light Poster
42 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: