RemotingObject对象中需要使用配置文件变量时怎么处理?

解决方案 »

  1.   

    http://www.cnblogs.com/wayfarer/category/1235.html这个家伙对Remoting还是比较厉害的,我是比较佩服的!
      

  2.   

    我写了一个函数
            public string link()
            {
                string IPstr = "";
                string filePath = Application.StartupPath + "\\IP.ini";
                IniFile dbini = new IniFile(filePath);
                IPstr = dbini.IniReadValue("IP", "ip");
                IPstr = IPstr + "/BroadCastMessage.soap";
                //textBox1.Text=IPstr;
                BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
                BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
                serverProvider.TypeFilterLevel = TypeFilterLevel.Full;            IDictionary props = new Hashtable();
                props["port"] = 0;
                props["name"] = "ClientHttp";
                HttpChannel channel = new HttpChannel(props, clientProvider, serverProvider);
                ChannelServices.RegisterChannel(channel,false);
                return IPstr;        }
    读取IP.ini文件就好了不知道对你有用吗
      

  3.   

    to liuqm:我刚刚开始Remoting,也从wayfarer那儿学了不少知识。PFPFto bjgzxx:读配置文件的方法好像不太适合,因为Object中的方法是在客户端调用的,这样客户端就要有IP.ini文件了。