private void button3_Click(object sender, EventArgs e)
{
int D =12;
//将D转成2进制字符串形式;
string str = Convert.ToString(D,2);
string str1 = str.Substring(2,1);
ushort Sh = Convert.ToUInt16(str1);
bool DD =Convert.ToBoolean(Sh);
if (DD)
{
button3.BackColor = Color.Red;
}
else
{
button3.BackColor = Color.Green;
}
textBox1.AppendText(str);
}