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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.