使用系统API函数,需要使用命名空间:System.Runtime.InteropServices;
1.if (textBoxPath.Text == String.Empty )
2.if (textBoxPath.Text == "" )
3.if (String.IsNullOrEmpty(textBoxPath.Text))
本文介绍在C# Winform应用中,通过三种方法判断文本框内容是否为空的技巧,包括使用String.Empty、空字符串及String.IsNullOrEmpty方法。
使用系统API函数,需要使用命名空间:System.Runtime.InteropServices;
1.if (textBoxPath.Text == String.Empty )
2.if (textBoxPath.Text == "" )
3.if (String.IsNullOrEmpty(textBoxPath.Text))
转载于:https://www.cnblogs.com/hhhhan1025/p/10679162.html
1094
859
8756

被折叠的 条评论
为什么被折叠?