首次提交

This commit is contained in:
XingCheng3
2026-05-11 11:09:04 +08:00
commit 79c0f9cd43
260 changed files with 33504 additions and 0 deletions

25
SCADA/Core/PLC_R.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Text;
namespace DC_A95
{
public class PLC_R
{
/// <summary>
/// 清理PLC字符串乱码统一入口支持object参数
/// 过滤不可见字符保留可打印ASCII和中文等有效字符
/// </summary>
public static string GetString_CleanGarbled(object input)
{
if (input == null) return "";
string str = input.ToString();
if (string.IsNullOrEmpty(str)) return "";
var sb = new StringBuilder();
foreach (char c in str)
{
if (c >= 0x20 && c < 0xFFFE) sb.Append(c);
}
return sb.ToString().Trim();
}
}
}