【发布时间】:2019-10-07 01:59:20
【问题描述】:
我有一个DomainUpDown 窗口。我需要从DomainUpDown 窗口中读取值,然后在我的if() 中检查它。例如我给出代码:
怎么做才合适?
string a;
if(DomainUpDown.Text == "Text1")
{
a="0";
}
else
{
a="1";
}
【问题讨论】:
-
这是winforms吗?
-
是.......................
-
你所拥有的有什么问题...除了
"0"和"1"都不是数字? -
没有看到任何上下文,我们无法判断是否有更好的方法 - 但如果要求是
set the variable string a to the value "1" or "0" depending on the text property of the object DomainUpDown,则您的代码没有任何问题