已有56人关注
关于remoting文件传递请教六。
发表在C#图书答疑 2010-07-02
是否精华
版块置顶:
谢谢您们及时回帖!!!以下继续请教了。
一。
1..利用线程技术实现异步(并行运行)原理知道了。那么,异步函数体(方法)可在RemotingClass库中,按照多线程语法创建。
2..关键是,
(1)服务器怎样将结束信息(消息)传递给客户端呢?
(2)客户端这样接受服务器(远程)送来的结束信息(消息)呢?
3..人家的经验(实例)?  如果不太复杂能否提供样本或简单实例呢!

二。以下试验对于我非常有用,一定想调试通过,所以,继续麻烦你们了!
///////////////////////////////////////////////////////////////////////////
         private void RemotingServerForm_Load(object sender, EventArgs e)
        {
            TcpChannel chan = new TcpChannel(9999);
            ChannelServices.RegisterChannel(chan);

            FarClass fc = new FarClass();
            ObjRef obj = RemotingServices.Marshal(fc, "Tcpservice");
            RemotingServices.Unmarshal(obj);
 //           FarClass fc = new FarClass();
     //       MessageBox.Show("远程类对象被第" + fc.GetTime().ToString() + "次调用");
//            RemotingConfiguration.Configure("RemotingServer.exe.Config", false);
            this.label1.Text = "服务端已启动";
        }

警告1“System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)”已过时:“Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.” E:\c#范例宝典2008\mingrisoft\19\EX19_03\RemotingServer\RemotingServer\RemotingServerForm.cs 27 13 RemotingServer
///////////////////////////////////////////////////////////////////////////
ChannelServices.RegisterChannel(chan);系统提示”已过时:“Use
对于这条语句系统就不认了,???  
ChannelServices.RegisterChannel(chan,true);
ChannelServices.RegisterChannel(chan,flase);
之中选哪一个?
///////////////////////////////////////////////////////////////////////////
   private void RemotingClientForm_Load(object sender, EventArgs e)
        {
           ChannelServices.RegisterChannel(new TcpChannel());

           WellKnownClientTypeEntry RemotingConfing = new WellKnownClientTypeEntry(typeof(FarClass), "tcp://localhost:9999/TcpService");
           RemotingConfiguration.RegisterWellKnownClientType(RemotingConfing);
//             RemotingConfiguration.Configure("RemotingClient.exe.Config",false);
            fc = new FarClass();
        }
警告1 “System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)”已过时:“Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.” E:\c#范例宝典2008\mingrisoft\19\EX19_03\RemotingClient\RemotingClient\RemotingClientForm.cs 33 12 RemotingClient

//////////////////////////////////////////////////////////////////////////
对于这条语句系统就不认了,???  
ChannelServices.RegisterChannel(new TcpChannel());
系统提示”已过时:“Use
怎样选择(IChannel chnl, bool ensureSecurity)参数呢?
(1)chnl从哪儿来?
(2)true/flase,选哪一个?
分享到:
精彩评论 1
东方_mrkj
学分:0 LV1
2010-07-02
沙发
曹老师你好:
      对于您的出的问题,原因是这样,RegisterChannel(IChannel chan)方法适用于早期的VS版本,新的VS版本已将该方法放弃。新版本vs中使用RegisterChannel(chan,bool)这个方法,对于这个bool类型的参数,如果启用了安全,则为 true;否则为 false。将该值设置为 false 将不会使在 TCP 或 IPC 信道上所做的安全设置无效。
     您提出的问题我们都会尽力给您回答,实际上您本次提出的某些问题已超出所购买的图书中的内容,但客服人员还是尽力做了回答,限于客服人员时间有限,还要为更多的读者服务,您提出的某些问题我们会在即将编写的图书中逐步落实,谢谢曹老师您对我公司的大力支持。
首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照