更新项目配置,新增设备同步模块,优化WebSocket和Swagger配置,增强SCADA系统的免登录接口,支持数据字典项和登录日志的免登录查询与记录。调整Java编译设置,确保更好的开发体验。
This commit is contained in:
28
yy-admin-master/YY.Admin.Core/Util/StringUtil.cs
Normal file
28
yy-admin-master/YY.Admin.Core/Util/StringUtil.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace YY.Admin.Core.Util
|
||||
{
|
||||
public class StringUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// HTML实体编码转换为C#/WPF支持的Unicode转义格式
|
||||
/// </summary>
|
||||
/// <param name="htmlEntity"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertHtmlEntityToUnicode(string htmlEntity)
|
||||
{
|
||||
if (string.IsNullOrEmpty(htmlEntity))
|
||||
return string.Empty;
|
||||
|
||||
if (htmlEntity.StartsWith("&#x") && htmlEntity.EndsWith(";"))
|
||||
{
|
||||
string hexCode = htmlEntity.Substring(3, htmlEntity.Length - 4);
|
||||
if (int.TryParse(hexCode, NumberStyles.HexNumber, null, out int unicodeValue))
|
||||
{
|
||||
return char.ConvertFromUtf32(unicodeValue);
|
||||
}
|
||||
}
|
||||
return htmlEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user