private void Submitbtn_Click(object sender, EventArgs e) { String Hostname = Clientnametbx.Text + Locationcodelbx.Text; String Client = Clientnametbx.Text; String Hostfile = ((@"c:\clients\" + Client) + (@"\" + Hostname + ".txt")); if (Textfilerbtn.Checked) { //Opens the .TXT File to allow copy to the system// Configuration(); System.Diagnostics.Process.Start((@"c:\clients\" + Client) + (@"\" + Hostname + ".txt")); } if (Commportrbtn.Checked) // Writes configurations to the serial port on the computer// { Configuration(); string Portconfiguration = "com" + CommPortbtn.Text; SerialPort port = new SerialPort(Portconfiguration, 9600, Parity.None, 8, StopBits.One); // Open the port for communications// port.Open(); //Write Configuration file to System using (StreamReader config = new StreamReader(Hostfile)) { port.Write(File.OpenText(Hostfile).ReadToEnd()); } //Close the port// port.Close(); System.Diagnostics.Process.Start((@"c:\clients\" + Client) + (@"\" + Hostname + ".txt")); MessageBox.Show("Please review the system configuration on the system"); } else { } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)