我在ASP.NET上有這個列表,我想找到從文本框給出的connectionid,並找到匹配的用戶,並將他的暱稱寫入另一個文本框。我怎樣才能做到這一點?列表C#找到匹配用戶
static List<User> users = new List<User>();
class User
{
public string connectionid { get; set; }
public string nick { get; set; }
}
protected void Button2_Click(object sender, EventArgs e)
{
//I want to find connectionid from TextBox1, write the matching User nick into TextBox2
}
查看修改答案 –