有人可以帮我将其转换为 vb.net 2010 代码。我有一个带有 textbox1 的窗口,我发现这个代码 bt cldnt 图我可以在 vb.net 2010 中编写它
Imports System.Diagnostics
Module Module1
Sub Main()
Dim pc As New PerformanceCounterCategory("Network Interface")
Dim instance As String = pc.GetInstanceNames(0)
Dim bs As New PerformanceCounter("Network Interface", "Bytes Sent/sec", instance)
Dim br As New PerformanceCounter("Network Interface", "Bytes Received/sec", instance)
Console.WriteLine("Monitoring " & instance)
Do
Dim kbSent As Integer = bs.NextValue() / 1024
Dim kbReceived As Integer = br.NextValue() / 1024
Console.WriteLine(String.Format("Bytes Sent {0}k Bytes Received {1}k", kbSent, kbReceived))
Threading.Thread.Sleep(1000)
Loop
End Sub
End Module