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

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

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

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

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

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

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

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

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

相关文章:

  • 2021-10-09
  • 2022-01-25
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2021-11-27
  • 2021-11-28
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案