天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpcClientFormTest.PLCServiceTest;
using System.ServiceModel;
using System.Threading;
namespace OpcClientFormTest
{
public partial class Form1 : Form, IPLCServiceTestCallback
{
private PLCServiceTestClient proxy;
public Form1()
{
InitializeComponent();
InstanceContext site = new InstanceContext(this);
proxy = new PLCServiceTestClient(site);
string flag = System.DateTime.Now.ToString("HHmmss");
this.textBox2.Text = flag;
this.Text = flag;
proxy.Register(flag);
}
#region IPLCServiceTestCallback 成员
public void ReturnProductCode(string name)
{
this.textBox1.Text = name;
Random r = new Random();
this.BackColor = Color.FromArgb(255, r.Next(256), r.Next(256), r.Next(256));
}
#endregion
}
}