由博客:https://www.cnblogs.com/xiandedanteng/p/7069739.html 修改而来
/// <summary>
/// 判断是否十六进制格式字符串
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsHexadecimal(string str)
{
const string PATTERN = @"[A-Fa-f0-9]+$";
bool bo = System.Text.RegularExpressions.Regex.IsMatch(str, PATTERN);
if(bo == true){