开发者

ASP.NET C#: Create sub-folder in another website on same server

开发者 https://www.devze.com 2022-12-11 13:37 出处:网络
I am in the need to create sub-folders within another website on the same server as the requesting website. How do I go about doing this?

I am in the need to create sub-folders within another website on the same server as the requesting website. How do I go about doing this?

I have tried Server.MapPath(path) but it is creating the folder with开发者_StackOverflow社区in the current website.

I.E.:

websiteA on server 123 needs to create a directory within websiteB on server123.

Please help


You have to set full path in order to do this, eg. c:\www\othersite\somefolder (for example you may set it as a configuration value in your web.config). Otherwise ASP.NET won't let you go above the root of your site.

However, I recommend to think twice about it, because it doesn't sound like a good pattern.

0

精彩评论

暂无评论...
验证码 换一张
取 消