awing.Size(512, 533); this.Controls.Add(this.button5); this.Controls.Add(this.textBox8); this.Controls.Add(this.label7); this.Controls.Add(this.button4); this.Controls.Add(this.groupBox1); this.Controls.Add(this.button1); this.Controls.Add(this.t_send); this.Controls.Add(this.msg); this.Controls.Add(this.label2); this.Controls.Add(this.button3); this.Name = "Form1"; this.Text = "串口通讯(小y设计)"; this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing); this.Load += new System.EventHandler(this.Form1_Load); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false);
} #endregion
/// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } //程序开启,串口初始化 private void Form1_Load(object sender, System.EventArgs e) { mycom1.PortNum=iPort; mycom1.BaudRate=iRate; mycom1.ByteSize=bSize; mycom1.Parity=bParity; mycom1.StopBits=bStopBits; mycom1.ReadTimeout=iTimeout; if(this.OpenCom()) msg.AppendText("串口初始化成功……\r\n"); else msg.AppendText("串口初始化失败!\r\n"); } //显示包信息 public string dis_package(byte[] reb) { string temp=""; foreach(byte b in reb) temp+=b.ToStri 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |