如何使用ASP.NET C#在Windows中禁用根文件夹? [英] How can disable root folder in windows using ASP.NET C#?

查看:102
本文介绍了如何使用ASP.NET C#在Windows中禁用根文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我托管了我的应用程序(IIS),但我不想在Windows登录名中打开该文件夹。例如(C:\inetpup \wwwroot \ MyApplnFolder)。任何人都可以使用c#与asp.net共享示例代码。



我尝试过:



If I'm hosted my application (IIS), but i don't want to open that folder in windows login's. for example (C:\inetpup\wwwroot\MyApplnFolder). Can any one pls share the sample code using c# with asp.net.

What I have tried:

If I'm hosted my application (IIS), but i don't want to open that folder in windows login's. for example (C:\inetpup\wwwroot\MyApplnFolder). Can any one pls share the sample code using c# with asp.net.

推荐答案

本文将提供有关逻辑文件与虚拟文件的更多信息Asp.Net中的路径: MapPath - DotNetPerls [ ^ ]



更新:由于标题问题正在改变,上面的回答现在是不正确的。以下是修订后的回复:



Web应用程序在一组减少的权限下工作,以阻止托管服务的安全漏洞高于Web应用程序级别本身。所以使用ASP.NET C#在Windows中禁用根文件夹是不可能的,因为这是托管服务的责任,在这种情况下是IIS。
This article will have more information about logical versus virtual file paths in Asp.Net: MapPath - DotNetPerls[^]

UPDATE: Due to the title of the question being changed, the above response is now incorrect. Below is a revised response:

Web applications work under a reduced set of permissions to stop security breaches of the hosting service above the level of the web application itself. So disable root folder in windows using ASP.NET C# would not be possible as this is the responsibility of the hosting service, IIS in this case.


这篇关于如何使用ASP.NET C#在Windows中禁用根文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆