简体   繁体   中英

Convert text to number in DomainUpDown

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM