class1.cs

来自「Csharp网络应用案例导航 Csharp网络应用案例导航」· CS 代码 · 共 25 行

CS
25
字号
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;


namespace RemotingHello
{	
	class RemoteClient
	{		
		[STAThread]
		static void Main(string[] args)
		{
			RemoteObject ;
			TcpChannel channel;
			channel=new TcpChannel(0);
			ChannelServices.RegisterChannel(channel);
			remoteObject = (RemoteObject)Activator.GetObject( typeof(RemoteObject),
				"tcp://localhost:1234/RemoteHello" ); 
			remoteObject.SayHello();
			Console.Read();
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?