我是初学者;那位高手可以详细解释一下,下面的代码
System.Runtime.Remoting.RemotingConfiguration.Configure("abc.exe.config");
    XmlDocument xmlDocument = new XmlDocument();
    xmlDocument.Load("abc.exe.config");
    XmlNode xmlNode = xmlDocument.SelectSingleNode("//configuration/system.runtime.remoting/application/client/weYYknown"); 
    string url = xmlNode.Attributes["url"].InnerText;
    url.Substring(0,url.LastIndexOf("/"));
    FrmLogin frmLogin1=new FrmLogin();
        if (frmLogin1.DialogResult==DialogResult.OK)
    {
     FrmMain frmMain1 = new FrmMain();
     frmMain1.ServerUrl = url;
     frmLogin1.Close();
}

解决方案 »

  1.   

    //***通过abc.exe.config配置Remoting
    System.Runtime.Remoting.RemotingConfiguration.Configure("abc.exe.config");//***从abc.exe.config中获取第一个SAO服务的url(weYYknown应该是wellknown吧?)
    XmlDocument xmlDocument = new XmlDocument();
    xmlDocument.Load("abc.exe.config");
    XmlNode xmlNode = xmlDocument.SelectSingleNode("//configuration/system.runtime.remoting/application/client/weYYknown"); 
    string url = xmlNode.Attributes["url"].InnerText;//***这句让我摸不着头脑,估计是截取除服务名外的所有路径吧,但为何前面没有接受结果的变量?
    url.Substring(0,url.LastIndexOf("/"));//*** 下面的就不用说了吧?
    ...
      

  2.   

    通过配置文件启动REMOTING 服务