增加 升级功能的 日志监控

This commit is contained in:
2026-03-17 15:58:22 +08:00
parent ddd4f5a6b4
commit a93c11fbfe
8 changed files with 108 additions and 2 deletions

View File

@@ -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>