宿主机用的是IIS做的,在客户端象如下那样写,就能够访问 HelloServer obj2 = (HelloServer)Activator.GetObject( typeof(ClassLibrary3.HelloServer), "http://192.168.1.101/remoting/HelloServer.soap"); this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text); 但是客户端换成: HelloServer obj2=new HelloServer(); this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text); 在Web.config里加入如下,确不能正确访问宿主机: <system.runtime.remoting> <application> <client> <!--<wellknown type="HelloServer, General" url="http://localhost:8090/SayHello" />--> <wellknown mode="Singleton" type="ClassLibrary3.HelloServer,ClassLibrary3" url="http://192.168.1.101/remoting/HelloServer.soap" /> </client> <channels> <channel ref="http" useDefaultCredentials="true" /> </channels> </application> </system.runtime.remoting> 请大家指教下 相关文章: 2021-11-15 2021-09-20 2021-12-14 2021-12-19 2021-05-22 2021-07-07 2022-12-23 2021-06-11