GDI 中发生一般错误- 权限
当我尝试将图像文件保存到虚拟目录时,我收到“GDI+ 中发生一般错误”。这似乎是一个权限问题,因为在调试过程中,我将文件路径更改为本地硬盘驱动器并能够保存文件。
虚拟目录在特定域帐户下运行,对文件夹和共享具有完全控制权。 IIS 正在为图像提供服务,我可以在 IIS 中浏览虚拟目录的目录结构,还可以在以域帐户连接时保存、重命名和删除文件夹中的文件。
当我尝试从应用程序保存文件时,IIS 是否以除我或域帐户之外的其他用户身份进行连接?
任何对此的帮助将不胜感激!
When I attempt to save an image file to a virtual directory I get "A generic error occurred in GDI+." This seems to be a permission issue, because during the debug process, I changed the file path to my local hard drive and was able to save the file.
The virtual directory is running under a specific domain account, with full control given to the folder and the share. IIS is serving the images, and I can navigate through the directory structure of the virtual directory in IIS, and also save, rename and delete files in the folder while connected as the domain account.
When I attempt to save the file from the application, does IIS connect as some other user, other than me or the domain account?
Any help with this would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番谷歌搜索后,我们发现了 Rick Strahl 的博客文章,该文章修复了问题。为了确定应用程序运行的帐户,我们使用了 <%= Environment.UserName %> - 这返回了 ASPNET(IIS 5.1 - 没有 appPools),
然后我们将用户名和密码添加到 machine.config,以便应用程序将在我们指定的帐户下运行,而不是 ASPNET 帐户
C:\windows\Microsoft.NET\ Framework\v2.0.50727\CONFIG
希望这对某人有帮助!
After some Googling we found a blog post by Rick Strahl which fixed the problem. To determine the account that the application in running under we used <%= Environment.UserName %> - this returned ASPNET (IIS 5.1 - does not have appPools)
We then added a username and password to the machine.config so the app would run under an account that we specified and not the ASPNET account
C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
Hope this helps someone!