public static bool IsNullOrEmpty(string value) { if (value != null) { return (value.Length == 0); } return true; } 不要再傻着写下: if (string.IsNullOrEmpty(s) || s.Length == 0) 这样的C#代码了,会被耻笑的! 哎! 还是多熟悉.NET Framework吧 相关文章: