您的位置:程序门 -> .net技术 -> web services



webservice中使用openfilemapping出错,错误代码error_access_denied


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


webservice中使用openfilemapping出错,错误代码error_access_denied[已结贴,结贴人:shermoon]
发表于:2008-01-10 23:58:53 楼主
在webservice中调用openfilemapping()如下代码
intptr   mapphandle   =   openfilemapping(section_map_read,   true,   "data_file");
if   (mapphandle   !=   intptr.zero)
{
            ……………………
        closehandle(mapphandle);
}
else
{
        errorcode   =   getlasterror();
}
在调试状态下openfilemapping函数可以正常打开文件映射,放到站点测试时就不行了,errorcode=error_access_denied
在下面连接中
http://topic.csdn.net/t/20060906/16/5003324.html
“greennetboy(我的老婆叫静静)”提到权限的问题,我很认可,但是对于将openfilemapping做成windows   service,然后再wenservice调用这种方法不知该如何去做,请各位帮帮忙,解决燃眉之急。不胜感激。
发表于:2008-01-11 00:20:391楼 得分:0
up~~呵呵~~新手~~不会~~
发表于:2008-01-11 01:25:462楼 得分:10
intptr       mapphandle       =       openfilemapping(section_map_read,       true,       "data_file");  
if       (mapphandle       !=       intptr.zero)  
{  
                        ……………………  
                closehandle(mapphandle);  
}  
else  
{  
                errorcode       =       getlasterror();  
}  
//这段代码是运行在服务器的,把运行webservice的用户权限提高,win2000下asp_net用户,win2003下为network_service用户
发表于:2008-01-11 08:47:513楼 得分:0
to   hdt(倦怠)
因为刚刚接触web编程,很多地方不甚了解,webservice应该是iis宿主,然后aspx通过ie调用,置于把运行webservice的用户权限提高的方法,还望详细描述一下,谢谢。
发表于:2008-01-11 12:01:224楼 得分:10
权限没设好> ?
发表于:2008-01-14 10:10:375楼 得分:180
file   mapping创建的时候就应该给应用程序池用户分配访问权限
发表于:2008-01-15 14:31:486楼 得分:0
通过学习jiangsheng的博客文章http://blog.csdn.net/jiangsheng/archive/2004/06/24/25563.aspx,解决了该问题,谢谢。


快速检索

最新资讯
热门点击