0
有人可以幫助我將其轉換爲vb.net 2010代碼。我有一個具有TextBox1中的窗口,我發現這個代碼BT cldnt圖浩,我可以在vb.net寫2010將傳統的vb轉換爲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
這已經是* * VB.Net,它的不是傳統的VB。 – RBarryYoung 2013-04-25 20:21:00
附註:'Console.WriteLine'中的'String.Format'是多餘的。它支持已經[**複合格式化**](http://msdn.microsoft.com/en-us/library/txafckwd(v = vs.110).aspx)。 – 2013-04-25 20:25:20