By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,083 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

How to create a directory with web-base program?

P: n/a
ad
We can use System.IO namespace to create a directory in win-base program.

But when I want to create a directory in the server with web-base program,
System.IO namespace can't work?

How can I do that?
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You need to allow the ASP.NET process to write to disk and create
directories/files. There's nothing in System.IO that ceases to work when
called within the context of a web application - it's just that web
application have lower privileges than normal desktop ones.

This is an NTFS permission issue. If you adjust those you should be able to
do whatever you want to the disk.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
We can use System.IO namespace to create a directory in win-base program.

But when I want to create a directory in the server with web-base program,
System.IO namespace can't work?

How can I do that?

Nov 16 '05 #2

P: n/a
ad <ad@wfes.tcc.edu.tw> wrote:
We can use System.IO namespace to create a directory in win-base program.

But when I want to create a directory in the server with web-base program,
System.IO namespace can't work?

How can I do that?


The System.IO namespace works absolutely fine - but you need to make
sure that the ASP.NET account has all the permissions needed to do
whatever you want to do.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

P: n/a
System.IO should work just fine. You'll probably need Server.MapPath()
to translate the web address into a local disk path. Also note that the user
that the webserver is running under (usually, IUSR_xxxxxxx) needs to have
permission to write into that directory.

--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
We can use System.IO namespace to create a directory in win-base program.

But when I want to create a directory in the server with web-base program,
System.IO namespace can't work?

How can I do that?

Nov 16 '05 #4

P: n/a
ad
Thank,
I will try it!
"James Curran" <Ja*********@mvps.org> glsD
:u#**************@TK2MSFTNGP12.phx.gbl...
System.IO should work just fine. You'll probably need Server.MapPath() to translate the web address into a local disk path. Also note that the user that the webserver is running under (usually, IUSR_xxxxxxx) needs to have
permission to write into that directory.

--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
We can use System.IO namespace to create a directory in win-base program.
But when I want to create a directory in the server with web-base program, System.IO namespace can't work?

How can I do that?


Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.