Opening a text file on the local system from an asp.net web application

前端 未结 3 1530
旧时难觅i
旧时难觅i 2021-01-05 11:30

OK to add clarification after the comments posted and the fact I realise my original question was massively confusing. This is what I am trying to achieve....

This

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-05 12:11

    please see this page

    http://msdn.microsoft.com/en-us/library/58wxa9w5(v=vs.100).aspx

    Most importantly this line

    Use when you are working with an existing project or your site targets an older version of IIS, such as IIS 6, and it is not very important that your testing environment match the production environment closely. This server option is the default in Visual Studio. However, the Visual Studio Development Server runs in a different security context than full IIS, and may fail to reveal errors that can occur when you deploy to a production version of IIS.

    The issue is that IISExpress and the local dev server run under your security context. This allows them much more freedom to start processes and have access to files on the local system.

    IIS however runs in a much stricter security context and has a limited access to the machine at hand. Imagine if IIS could do what you are proposing above. you could basically run any arbitrary code on the webserver.

提交回复
热议问题