如何从Asp.Net Web应用程序写入本地系统中的文件 [英] How Do I Write To File In Local System From Asp.Net Web Application

查看:173
本文介绍了如何从Asp.Net Web应用程序写入本地系统中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Web应用程序,我将查询的输出存储在C盘中的文本文件中。当我在服务器中执行此操作时,我创建了应用程序,它完美地工作但是当我通过IIS托管它时没有工作。

I have created a web application and I am storing the the output of query in a text file in C drive.When i do this in the server I have created the application it works perfectly but when I host it through IIS it does not work.

推荐答案

非常简单的答案。



您的网站没有写入权限C盘。请与您的网络团队联系。
Very simple answer.

Your website is not having a write permission to the C drive. Please check with your network team.


当您从Visual Studio启动ASP .NET应用程序时,它以IIS上当前登录用户的权限

运行Express。



在IIS中运行的应用程序

使用所谓的应用程序池标识运行。

这是默认值。



请阅读:

http://www.iis.net/learn/manage/configuring-security/application-pool-identities [ ^ ]



如果您的应用程序池是DefaultAppPool

,您必须为用户分配权限IIS AppPool \DefaultAppPool
When you start an ASP .NET application from Visual Studio it runs with the rights
of the currently logged on user on IIS Express.

An application running in IIS
runs with a so-called Application-Pool Identity.
This is the default.

Please read:
http://www.iis.net/learn/manage/configuring-security/application-pool-identities[^]

If your application pool is "DefaultAppPool"
you must assign rights to user "IIS AppPool\DefaultAppPool"


这篇关于如何从Asp.Net Web应用程序写入本地系统中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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