简体   繁体   English

ASP.NET Webforms访问不在应用程序目录中的文件

[英]ASP.NET Webforms Accessing Files not in application directory

How can I programmatically access files via a url that are located in a directory not in the application directory? 如何通过编程方式通过不在应用程序目录中的目录中的URL访问文件? For example, if I have a url like mysite.com that paths to c:\\mysite, I want to have a url like: mysite.com/reports that paths to c:\\reports. 例如,如果我有一个类似于mysite.com的URL,它指向c:\\ mysite,则我想有一个类似URL:mysite.com/reports的c:\\ reports路径。

Am I able to write code that enables to sniff the incoming url request and map it to the appropriate directory? 我可以编写代码来嗅探传入的url请求并将其映射到适当的目录吗?

您可以尝试使用已经可以访问该文件夹的帐户来使用模拟,或者为IIS工作进程授予对所需文件夹的访问权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将CKEditor集成到ASP.Net Webforms应用程序中 - Integrating CKEditor in an ASP.Net Webforms Application 如何将对文件夹的访问限制为Asp.Net WebForms应用程序中的特定活动目录组? - How to restrict access to a folder to a specific active directory group in an Asp.Net WebForms application? 在 asp.net 应用程序网络表单中上传文件时找不到文件错误 - Could not find file error on uploading files in asp.net application webforms 将应用程序从 Asp.Net Webforms 更新到 .Net 6 - Update Application From Asp.Net Webforms to .Net 6 带有 Asp.net Webforms 的 Azure Active Directory SSO - Azure Active Directory SSO with Asp.net Webforms vb.net asp.net webforms application> c#asp.net mvc razor应用程序 - vb.net asp.net webforms application > c# asp.net mvc razor application Api for ASP.NET Web 应用程序(WebForms)项目显示 400 - Api for ASP.NET Web Application (WebForms) Project showing 400 使AsyncFileUpload仅接受图像文件Asp.Net Webforms - Make AsyncFileUpload accepts only images files Asp.Net Webforms 试图创建数据库的ASP.NET WebForms应用程序 - ASP.NET WebForms application trying to create a database 如何使用ASP.NET WebForms应用程序中的HTML菜单解决此问题? - How to resolve this issue with HTML menu in ASP.NET WebForms application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM