frmmain.cs

来自「OPCserver OPCserver.rar」· CS 代码 · 共 454 行 · 第 1/2 页

CS
454
字号
#define Win32
//using Microsoft.VisualBasic;
//using AxComctlLib; 
using System.Data;
using Microsoft.VisualBasic.Compatibility;
using System;
using System.Collections;
using System.Windows.Forms;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;   
using CNETServer;
namespace CNETServer
{
	
	internal class FrmMain : System.Windows.Forms.Form
	{ 
		[STAThread]
		static void Main()
		{ 

			Application.Run(new FrmMain());			
		}
		#region "Windows 窗体设计器生成的代码"
		public FrmMain()
		{
			if (m_vb6FormDefInstance == null)
			{
				if (m_InitializingDefInstance)
				{
					m_vb6FormDefInstance = this;
				}
				else
				{
					try
					{
						//对于启动窗体,所创建的第一个实例为默认实例。
						if (System.Reflection.Assembly.GetExecutingAssembly().EntryPoint.DeclaringType == this.GetType())
						{
							m_vb6FormDefInstance = this;
						}
					}
					catch
					{
					}
				}
			}
			//此调用是 Windows 窗体设计器所必需的。
			InitializeComponent();
		}
		//窗体重写处置,以清理组件列表。
		protected override void Dispose(bool Disposing)
		{
			if (Disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose(Disposing);
		}

		private System.ComponentModel.IContainer components;
		public System.Windows.Forms.ToolTip ToolTip1;
		public System.Windows.Forms.TextBox Text1;
		public System.Windows.Forms.Timer Timer1;		
		public System.Windows.Forms.MenuItem IDR_Menu_Register;
		public System.Windows.Forms.MenuItem IDR_Menu_UnRegister;
		public System.Windows.Forms.MenuItem IDR_Menu_0001;
		public System.Windows.Forms.MenuItem IDR_Menu_SvrStatus;
		public System.Windows.Forms.MenuItem IDR_Menu_0003;
		public System.Windows.Forms.MenuItem IDR_Menu_AddItem;
		public System.Windows.Forms.MenuItem IDR_Menu_DelItem;
		public System.Windows.Forms.MenuItem IDR_Menu_0002;
		public System.Windows.Forms.MenuItem IDR_Menu_Exit;
		public System.Windows.Forms.MenuItem IDR_Menu_OPC;
		public System.Windows.Forms.MenuItem IDR_Menu_Start;
		public System.Windows.Forms.MenuItem IDR_Menu_Stop;
		public System.Windows.Forms.MenuItem IDR_Menu_DataTime;
		public System.Windows.Forms.MenuItem IDR_Menu_About;
		public System.Windows.Forms.TextBox txtDebug;
		public System.Windows.Forms.MainMenu MainMenu1;
		//注意: 以下过程是 Windows 窗体设计器所必需的
		//可以使用 Windows 窗体设计器来修改它。
		//不要使用代码编辑器修改它。
		[System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components);
			this.Text1 = new System.Windows.Forms.TextBox();
			this.Timer1 = new System.Windows.Forms.Timer(this.components);
			this.MainMenu1 = new System.Windows.Forms.MainMenu();
			this.IDR_Menu_OPC = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_Register = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_UnRegister = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_0001 = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_SvrStatus = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_0003 = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_AddItem = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_DelItem = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_0002 = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_Exit = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_DataTime = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_Start = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_Stop = new System.Windows.Forms.MenuItem();
			this.IDR_Menu_About = new System.Windows.Forms.MenuItem();
			this.txtDebug = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// Text1
			// 
			this.Text1.AcceptsReturn = true;
			this.Text1.AutoSize = false;
			this.Text1.BackColor = System.Drawing.SystemColors.Window;
			this.Text1.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.Text1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Text1.ForeColor = System.Drawing.SystemColors.WindowText;
			this.Text1.Location = new System.Drawing.Point(0, 0);
			this.Text1.MaxLength = 0;
			this.Text1.Multiline = true;
			this.Text1.Name = "Text1";
			this.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Text1.Size = new System.Drawing.Size(648, 288);
			this.Text1.TabIndex = 1;
			this.Text1.Text = "";
			this.Text1.TextChanged += new System.EventHandler(this.Text1_TextChanged);
			// 
			// Timer1
			// 
			this.Timer1.Interval = 3000;
			this.Timer1.Tick += new System.EventHandler(this.Timer1_Tick);
			// 
			// MainMenu1
			// 
			this.MainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.IDR_Menu_OPC,
																					  this.IDR_Menu_DataTime,
																					  this.IDR_Menu_About});
			// 
			// IDR_Menu_OPC
			// 
			this.IDR_Menu_OPC.Index = 0;
			this.IDR_Menu_OPC.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						 this.IDR_Menu_Register,
																						 this.IDR_Menu_UnRegister,
																						 this.IDR_Menu_0001,
																						 this.IDR_Menu_SvrStatus,
																						 this.IDR_Menu_0003,
																						 this.IDR_Menu_AddItem,
																						 this.IDR_Menu_DelItem,
																						 this.IDR_Menu_0002,
																						 this.IDR_Menu_Exit});
			this.IDR_Menu_OPC.Text = "OPC";
			// 
			// IDR_Menu_Register
			// 
			this.IDR_Menu_Register.Index = 0;
			this.IDR_Menu_Register.Text = "Register";
			this.IDR_Menu_Register.Popup += new System.EventHandler(this.IDR_Menu_Register_Popup);
			this.IDR_Menu_Register.Click += new System.EventHandler(this.IDR_Menu_Register_Click);
			// 
			// IDR_Menu_UnRegister
			// 
			this.IDR_Menu_UnRegister.Index = 1;
			this.IDR_Menu_UnRegister.Text = "UnRegister";
			this.IDR_Menu_UnRegister.Popup += new System.EventHandler(this.IDR_Menu_UnRegister_Popup);
			this.IDR_Menu_UnRegister.Click += new System.EventHandler(this.IDR_Menu_UnRegister_Click);
			// 
			// IDR_Menu_0001
			// 
			this.IDR_Menu_0001.Index = 2;
			this.IDR_Menu_0001.Text = "-";
			// 
			// IDR_Menu_SvrStatus
			// 
			this.IDR_Menu_SvrStatus.Index = 3;
			this.IDR_Menu_SvrStatus.Text = "Server Status";
			this.IDR_Menu_SvrStatus.Popup += new System.EventHandler(this.IDR_Menu_SvrStatus_Popup);
			this.IDR_Menu_SvrStatus.Click += new System.EventHandler(this.IDR_Menu_SvrStatus_Click);
			// 
			// IDR_Menu_0003
			// 
			this.IDR_Menu_0003.Index = 4;
			this.IDR_Menu_0003.Text = "-";
			// 
			// IDR_Menu_AddItem
			// 
			this.IDR_Menu_AddItem.Index = 5;
			this.IDR_Menu_AddItem.Text = "Add Item";
			this.IDR_Menu_AddItem.Popup += new System.EventHandler(this.IDR_Menu_AddItem_Popup);
			this.IDR_Menu_AddItem.Click += new System.EventHandler(this.IDR_Menu_AddItem_Click);
			// 
			// IDR_Menu_DelItem
			// 
			this.IDR_Menu_DelItem.Index = 6;
			this.IDR_Menu_DelItem.Text = "Delete Item";
			this.IDR_Menu_DelItem.Popup += new System.EventHandler(this.IDR_Menu_DelItem_Popup);
			this.IDR_Menu_DelItem.Click += new System.EventHandler(this.IDR_Menu_DelItem_Click);
			// 
			// IDR_Menu_0002
			// 
			this.IDR_Menu_0002.Index = 7;
			this.IDR_Menu_0002.Text = "-";
			// 
			// IDR_Menu_Exit
			// 
			this.IDR_Menu_Exit.Index = 8;
			this.IDR_Menu_Exit.Text = "Exit";
			this.IDR_Menu_Exit.Popup += new System.EventHandler(this.IDR_Menu_Exit_Popup);
			this.IDR_Menu_Exit.Click += new System.EventHandler(this.IDR_Menu_Exit_Click);
			// 
			// IDR_Menu_DataTime
			// 
			this.IDR_Menu_DataTime.Index = 1;
			this.IDR_Menu_DataTime.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																							  this.IDR_Menu_Start,
																							  this.IDR_Menu_Stop});
			this.IDR_Menu_DataTime.Text = "Data Time";
			// 
			// IDR_Menu_Start
			// 
			this.IDR_Menu_Start.Index = 0;
			this.IDR_Menu_Start.Text = "Start";
			this.IDR_Menu_Start.Popup += new System.EventHandler(this.IDR_Menu_Start_Popup);
			this.IDR_Menu_Start.Click += new System.EventHandler(this.IDR_Menu_Start_Click);
			// 

⌨️ 快捷键说明

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