"#"); sw.Write("3," + 255 + "#"); sw.Write("4," + 255 + "#"); sw.Write("5," + 255 + "#"); sw.Write("6," + 255 + "#"); sw.Flush(); textBox1.Text = "255"; textBox2.Text = "255"; textBox3.Text = "255"; textBox4.Text = "255"; textBox7.Text = "255"; textBox8.Text = "255"; hScrollBar1.Value = Convert.ToInt16(textBox1.Text); hScrollBar2.Value = Convert.ToInt16(textBox2.Text); hScrollBar3.Value = Convert.ToInt16(textBox3.Text); hScrollBar4.Value = Convert.ToInt16(textBox4.Text); hScrollBar5.Value = Convert.ToInt16(textBox7.Text); hScrollBar6.Value = Convert.ToInt16(textBox8.Text); } private void button9_Click(object sender, EventArgs e) { StreamWriter sw; //總開關”關”控制 sw = new StreamWriter(net); sw.Write("1," + 0 + "#"); sw.Write("2," + 0 + "#"); sw.Write("3," + 0 + "#"); sw.Write("4," + 0 + "#"); sw.Write("5," + 0 + "#"); sw.Write("6," + 0 + "#"); sw.Flush(); textBox1.Text = "0"; textBox2.Text = "0"; textBox3.Text = "0"; textBox4.Text = "0"; textBox7.Text = "0"; textBox8.Text = "0"; hScrollBar1.Value = Convert.ToInt16(textBox1.Text); hScrollBar2.Value = Convert.ToInt16(textBox2.Text); hScrollBar3.Value = Convert.ToInt16(textBox3.Text); hScrollBar4.Value = Convert.ToInt16(textBox4.Text); hScrollBar5.Value = Convert.ToInt16(textBox7.Text); hScrollBar6.Value = Convert.ToInt16(textBox8.Text); } } }