I’m developing a Windows application in VS2005 using C#. In my project, I generate dlls and store them in a directory. The dlls will be named as TestAssembly1, TestAssembly2, TestAssembly3 etc.
So consider if the above three dlls are in the directory. The next time the user uses my project, I need to generate dlls like TestAssembly4, TestAssembly5 etc.
So how can I store the count of the dlls in the folder and increment them when the project is used the next time?
The directory can even contain files other than dlls. So how can I do this?
You would just use Directory.GetFiles, passing in a pattern for the files you want to return:
http://msdn.microsoft.com/en-us/library/wz42302f.aspx