ASP.NET C#:在同一服务器上的另一个网站中创建子文件夹

发布于 2024-08-11 07:19:13 字数 178 浏览 1 评论 0原文

我需要在与请求网站同一服务器上的另一个网站中创建子文件夹。我该怎么做呢?

我尝试过 Server.MapPath(path) 但它正在当前网站内创建文件夹。

IE:

服务器 123 上的 websiteA 需要在服务器 123 上的 websiteB 中创建一个目录。

请帮忙

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 within the current website.

I.E.:

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

Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星星的轨迹 2024-08-18 07:19:13

您必须设置完整路径才能执行此操作,例如。 c:\www\othersite\somefolder (例如,您可以将其设置为 web.config 中的配置值)。否则,ASP.NET 不会让您访问站点的根目录之上。

不过,我建议三思而后行,因为这听起来不是一个好的模式。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文