增加 升级功能的 日志监控
This commit is contained in:
@@ -497,6 +497,22 @@ namespace Common
|
||||
arry[1] = (byte)(data & 0xFF);
|
||||
return arry;
|
||||
}
|
||||
|
||||
// 方法B:自定义字符数组判断
|
||||
public static bool ContainsSpecialChars(string input)
|
||||
{
|
||||
// 定义特殊字符数组
|
||||
char[] specialChars = {
|
||||
'!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
|
||||
'+', '=', '[', ']', '{', '}', '|', '\\', ':', ';',
|
||||
'"', '\'', '<', '>', ',', '.', '?', '/', '`', '~'
|
||||
};
|
||||
|
||||
// 判断是否包含空白字符(空格、制表符、换行符等)
|
||||
bool hasWhiteSpace = input.Any(char.IsWhiteSpace);
|
||||
return input.Any(c => specialChars.Contains(c))&&hasWhiteSpace;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把int32类型的数据转存到2个字节的byte数组中:小端
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user