private void button5_Click(object sender, EventArgs e) { if (pcu != null) { pcu.TestRomote(); } }
private PCUSimulator getPCUObject() { try { ChannelServices.RegisterChannel(new TcpClientChannel(), false); PCUSimulator simulator = (PCUSimulator)Activator.GetObject(typeof(PCUSimulator), "tcp://localhost:6688/PCUSimulater"); simulator.TestRomote(); if (simulator != null) { // MessageBox.Show("成功获取remote PCU"); } return(simulator); } catch (Exception ex) { return(null); } }