Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to write code to create a physical folder with ASP.net
.like i want to let a user to create a folder for uploading something and then retrieve the folder data, any help is appreciated
Thanks in advance
Posted
Comments
shakil0304003 6-Mar-11 11:30am    
Use google 1st!!!

You can try this
string path = Server.MapPath("Solution");
path += "\\" + user.ID.ToString();
DirectoryInfo df = new DirectoryInfo(path);

if (!df.Exists)
    df.Create();
 
Share this answer
 
Comments
Maral Azizi 8-Mar-11 7:13am    
thank u so muchhhh :)
i test this and its work fluently
string path = Server.MapPath("~/images/");
DirectoryInfo df = new DirectoryInfo(path + TextBox1.Text);
if (!df.Exists)
df.Create();
shakil0304003 8-Mar-11 10:23am    
Thanks :)
Something wrong with the Directory.CreateDirectory method? MSDN[^]
 
Share this answer
 
Comments
Maral Azizi 6-Mar-11 6:39am    
I don't need this i want to allow admin to create a folder for some specific data, like he just can select or write a name for a folder and then system create a folder for him , suppose i will get a textbox.text as folder name and then system should make a folder by this name , I think its possible by fso but i don't know what to do :(
Maral Azizi 6-Mar-11 7:30am    
i want something like this :
FSO = Server.CreateObject("Scripting.FileSystemObject")
Folder = FSO.CreateFolder("c:\" & Me.textbox1.Text & "_" &
Me.textbox2.Text & "_" & newString) but instead of c: i need this path : www.xxx.com/yyy/zzz ,
Thanks for any help or suggestion

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