I have a DomainUpDown
window. I need to read the value from DomainUpDown
window and next check this in my if()
. For example I give the code: How to do it properly?
string a;
if(DomainUpDown.Text == "Text1")
{
a="0";
}
else
{
a="1";
}
你可以缩短它(我想你的数字应该是一个整数):
int myNumber = DomainUpDown.Text == "Text1" ? 0 : 1;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.