Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 06, 2012 11:07 AM by Ruchira
Member
364 Points
651 Posts
Oct 30, 2012 09:16 PM|LINK
Hi,
I am hosting on a remote host somewhere in US.
I have a folder with sub folders inside it. The folder name is : member
I want when creating a new member to copy the folder and all its subfolder to a new folder called xxx
both member folders and xxx folder are in ~/images/
how can I do this?
Thanks,
All-Star
15922 Points
2982 Posts
Oct 31, 2012 05:18 AM|LINK
Hello,
You could check at http://forums.asp.net/t/1802144.aspx/1.
Regards
Contributor
2143 Points
504 Posts
Oct 31, 2012 08:32 AM|LINK
using DirectoryInfo class you can achieve the same
97799 Points
14494 Posts
Oct 31, 2012 09:05 AM|LINK
USe System.IO.Directory class..get the directory...then Create a new Directory using CreateDirectory()....then iterate GetFiles() from first directory....finally make File.Copy....
Oct 31, 2012 05:50 PM|LINK
I tried this but not working:
string path = "~/images/" + "TTTTTTT"; DirectoryInfo directoryInfo = new DirectoryInfo(Server.MapPath(path)); if (!directoryInfo .Exists) { directoryInfo .Create(); }
I am not getting any error but directory is not getting created either!
Nov 01, 2012 07:11 PM|LINK
Please help...
44216 Points
7184 Posts
MVP
Nov 06, 2012 11:07 AM|LINK
jrahma string path = "~/images/" + "TTTTTTT"; DirectoryInfo directoryInfo = new DirectoryInfo(Server.MapPath(path)); if (!directoryInfo .Exists) { directoryInfo .Create(); }
Try this
string path = "~/images/" + "TTTTTTT"; if (!Directory.Exists(Server.MapPath(path))) { Directory.CreateDirectory(Server.MapPath(path)); }
Please 'Mark as Answer' if this post helps you.
jrahma
Member
364 Points
651 Posts
copy folder on web server
Oct 30, 2012 09:16 PM|LINK
Hi,
I am hosting on a remote host somewhere in US.
I have a folder with sub folders inside it. The folder name is : member
I want when creating a new member to copy the folder and all its subfolder to a new folder called xxx
both member folders and xxx folder are in ~/images/
how can I do this?
Thanks,
Technology News @ www.JassimRahma.com
HostingASPNe...
All-Star
15922 Points
2982 Posts
Re: copy folder on web server
Oct 31, 2012 05:18 AM|LINK
Hello,
You could check at http://forums.asp.net/t/1802144.aspx/1.
Regards
Free ASP.NET Examples and source code.
sureshkumar....
Contributor
2143 Points
504 Posts
Re: copy folder on web server
Oct 31, 2012 08:32 AM|LINK
using DirectoryInfo class you can achieve the same
Best Regards,
Suresh Kumar Gundala
ramiramilu
All-Star
97799 Points
14494 Posts
Re: copy folder on web server
Oct 31, 2012 09:05 AM|LINK
USe System.IO.Directory class..get the directory...then Create a new Directory using CreateDirectory()....then iterate GetFiles() from first directory....finally make File.Copy....
Thanks,
JumpStart
jrahma
Member
364 Points
651 Posts
Re: copy folder on web server
Oct 31, 2012 05:50 PM|LINK
I tried this but not working:
string path = "~/images/" + "TTTTTTT"; DirectoryInfo directoryInfo = new DirectoryInfo(Server.MapPath(path)); if (!directoryInfo .Exists) { directoryInfo .Create(); }I am not getting any error but directory is not getting created either!
Technology News @ www.JassimRahma.com
jrahma
Member
364 Points
651 Posts
Re: copy folder on web server
Nov 01, 2012 07:11 PM|LINK
Please help...
Technology News @ www.JassimRahma.com
Ruchira
All-Star
44216 Points
7184 Posts
MVP
Re: copy folder on web server
Nov 06, 2012 11:07 AM|LINK
Hello,
Try this
string path = "~/images/" + "TTTTTTT"; if (!Directory.Exists(Server.MapPath(path))) { Directory.CreateDirectory(Server.MapPath(path)); }
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.