how to Create Newfolder dynamically in asp.net.

Posted by Dn2010 under ASP.NET on 2/13/2011 | Points: 10 | Views : 5370 | Status : [Member] | Replies : 6
hi friends,

how to Create Newfolder dynamically in asp.net.

please give in detail.

thanks.




Responses

Posted by: Abhi2434 on: 2/13/2011 [Member] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Use Directory.CreateDirectory.

www.abhisheksur.com

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/13/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

try this

DirectoryInfo dirTemp = new DirectoryInfo("D:\\MyFiles");
if (!dirTemp.Exists)
{
dirTemp.Create();
}

Thanks
Karthik
www.f5Debug.net

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

In the code behind you can write this

if(!Directory.Exists("c:\\test"))
Directory.CreateDirectory("c:\\test"))



Thanks and Regards
Madhu

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 2/14/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi


simply write this code . .


Directory.CreateDirectory("c:\\img"))

Best Regard's
Prabhakar

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dn2010 on: 2/14/2011 [Member] Starter | Points: 25

Up
0
Down
thanks to all.........................

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Thanks everyone, even I needed the same :)

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response