if(string.IsNullOrEmpty(tbx.Text))....或者用string.IsNullOrWhiteSpace(tbx.Text)粗略一点的也可以直接 if(tbx.Text=="")