Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have create a button on which i wana create a folder in solution explorer.how will i do it?plz explain.
Posted

1 solution

Try to use Google!!

System.IO.Directory.CreateDirectory("C:\\MyNewFolder"); //This will create the folder "MyNewFolder"
 
Share this answer
 
v2
Comments
SURBHI TYAGI 8-Mar-11 2:13am    
This folder show in c drive but i want that when folder create than it show in Solution Explorer.
Ryan Zahra 8-Mar-11 2:19am    
The add a file to the solution, right click your solution, point to add, and click add folder.
SURBHI TYAGI 8-Mar-11 2:22am    
I know this sir.but can we create it by code? wizard base i knw but i want that the new folder will create in solution explorer as i click on button.that means i wana create new folder in solution explorer by code.
Ryan Zahra 8-Mar-11 2:27am    
I'm not 100% sure. However you can create the folder with the above code. Then in the solution explorer you must press the button to "Show All Files". This will show you all the files in the solution. You must then manually right click on the file and select "Include In Project". May I ask why you want such functionality?
SURBHI TYAGI 8-Mar-11 2:34am    
ya sure cz its an assignment of my sir?and m nt able to understand that how can i do it by code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900