-3
当我想清楚以下数组:使空文本框
userInfo[0] = txtPassword.Text;
userInfo[1] = txtVoornaam.Text;
userInfo[2] = txtAchternaam.Text;
userInfo[3] = txtWoonplaats.Text;
userInfo[4] = txtPostcode.Text;
userInfo[5] = txtTelnr.Text;
我做了以下内容:
for (int i = 0; i < 5; i++)
{
userInfo[i] = "";
}
这显然是行不通的,当我试试这个:
foreach (string item in userInfo)
{
item = "";
}
也不起作用。我怎样才能做到这一点毫无疑问:
userinfo[0] = txtPassword;
那么'用户信息[0] = txtPassword'不会编译。如果控件的内容不是_empty_ – MickyD
'userInfo','userInfo [0] = txtPassword.Text'可能与'userInfo [0] =“”'效果不同。一个'string []'?为什么'userInfo [i] =“”'''不起作用'? – TaW
也许你应该告诉我们什么'userInfo []'被_defined as_ – MickyD