在WEB程序中使用.NET Remoting的IpcChannel时注意事项(关于“拒绝访问”问题的解决)...

    前一段写的一个东西,需要控制远程的计算机做一些操作。由于有端口的访问限制,所以我选择了在服务器使用Web Service + Remoting IpcChannel + Windows Service的方式。在实现过程中遇到了这样的问题:通过web method调用IpcChannel时,总是提示Access denied。
    解决的方法就是在创建IpcChannel时指定authorizedGroup参数(无论是使用代码创建还是使用配置文件配置)
Hashtable ht  =   new  Hashtable();
ht[
" portName " =   " RemoteEncoder:9090 " ;
ht[
" name " =   " ipc " ;
ht[
" authorizedGroup " =   " Users " ;
IpcChannel channel 
=   new  IpcChannel(ht,  null null );
ChannelServices.RegisterChannel(channel, 
false );
RemotingConfiguration.RegisterWellKnownServiceType(
typeof (Server),  " Server.rem " , WellKnownObjectMode.Singleton);
 
这里指定了所有属于Users用户组的用户都可以访问这个IpcChannel. 好了,问题解决!备案。。。
posted on 2006-06-20 14:44 Vincent.Hu 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/sainthn/archive/2006/06/20/430585.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值