通过后面的代码对托管服务器中的目录进行写权限 [英] Write permission of a directory in a hosted server through code behind
本文介绍了通过后面的代码对托管服务器中的目录进行写权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我通过代码在应用程序的根目录中创建了一个文件夹,并将图像上传到该文件夹中...在本地系统中工作...当服务器中托管的应用程序正在创建目录时,当尝试显示图像时错误访问被拒绝".这意味着没有写权限...如何以编程方式进行操作...
请帮我...
欢迎所有建议
在Advance中致谢
Hi all,
I created a folder in the root directory of my application through the code and uploaded images to it...it worked in local system...when the application hosted in a server the directory is getting created and when trying to up images it shows error "Access Denied".It means do not have write permission ...How can i do it programatically...
Plz help me...
All Suggestions are welcome
Thanks in Advance
推荐答案
我对服务器没有任何经验,但是如果是C#,我建议您看看这些API
http://msdn.microsoft.com/zh-CN/library/system.io.directory.aspx
http://msdn.microsoft.com/zh-cn/library/system.io.directory.setaccesscontrol.aspx
另外,如果您的代码没有太多访问权限,则可以尝试为更高特权的帐户使用令牌.(但我不知道它的副作用)
http://msdn.microsoft.com/zh-CN/library/windows/desktop/aa374909(v = vs.85).aspx
I dont have any exprience with servers however if it is C# I will recommend you to have a look on these APIs
http://msdn.microsoft.com/en-us/library/system.io.directory.aspx
http://msdn.microsoft.com/en-us/library/system.io.directory.setaccesscontrol.aspx
Also if your code hasn''t got that much of access then you can try taking token for some higher privileged account.(But I dont know its side effects)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa374909(v=vs.85).aspx
这篇关于通过后面的代码对托管服务器中的目录进行写权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文