C# winform三种方法判断文本框textBox内容是否为空

C# winform三种方法判断文本框textBox内容是否为空

使用系统API函数,需要使用命名空间:System.Runtime.InteropServices;

1.if (textBoxPath.Text ==  String.Empty )

2.if (textBoxPath.Text == "" )

3.if (String.IsNullOrEmpty(textBoxPath.Text))

posted @ 2020-01-06 13:50  紫陌红尘520  阅读(3473)  评论(0编辑  收藏  举报