fix of the offset error

This commit is contained in:
谢桂纲 2024-01-26 09:32:26 +08:00
parent 39ab90eeb0
commit 6efb3d4ba1
3 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ Public Class netstat
Return
End If
For i As Integer = offset.i To lines.Length - 1
For i As Integer = offset.i + 1 To lines.Length - 1
If Not lines(i).StringEmpty Then
Dim tokens As String() = lines(i).StringSplit("\s+")

View File

@ -32,7 +32,7 @@ Public Module CentosTools
Call df.add("Foreign Address", netstat.Select(Function(a) a.ForeignAddress))
Call df.add("State", netstat.Select(Function(a) a.State))
Call df.add("PID/Program name", netstat.Select(Function(a) a.Program))
Call df.add("listened_port", netstat.Select(Function(a) If(a.LocalListenPort <= 0, Double.NaN, a.LocalListenPort)))
Call df.add("listened_port", netstat.Select(Function(a) a.LocalListenPort))
Return df
End Function

View File

@ -23,4 +23,4 @@ udp6 0 0 :::5353 :::*
";
print(centos::netstat(text1));
print(as.data.frame(centos::netstat(text1)));