-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