![]()
服务端
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//Remoting
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using Rca4.Remoting.Local;
namespace Rca4.RcaServer
{
public partial class FormServer : Form
{
public FormServer()
{
InitializeComponent();
}
private void FormServer_Load(object sender, EventArgs e)
{
TcpServerChannel channel = new TcpServerChannel(8080);
ChannelServices.RegisterChannel(channel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(LocalMod),
"LocalMod", WellKnownObjectMode.SingleCall);
}
}
}
public static LocalMod LocalObj = (LocalMod)Activator.GetObject(typeof(LocalMod),
"tcp://localhost:8080/LocalMod");