新增非法字段检查
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using ZstdSharp;
|
||||
|
||||
namespace MesETL.App.Helpers;
|
||||
@@ -121,5 +122,17 @@ public static partial class DumpDataHelper
|
||||
var reader = new StreamReader(ds);
|
||||
return await reader.ReadToEndAsync();
|
||||
}
|
||||
|
||||
|
||||
public static bool IsJson(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonDocument.Parse(str);
|
||||
return true;
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user