if(user !=null && user.Length>0)//这个常规判断,不可缺少
{
     txtbox1.text = user [0].UserName; //数组也是可以按索引访问的,不需要转化成list,没必要的性能消耗
}