VB.NET,如何调用外部程序?
1.VB2008Express版本。2.是在程序运行时调用。3.请用Explorer.exe举例子。4.有我认为我满意的回答我会加分。...
1.VB 2008 Express版本。
2.是在程序运行时调用。
3.请用Explorer.exe举例子。
4.有我认为我满意的回答我会加分。 展开
2.是在程序运行时调用。
3.请用Explorer.exe举例子。
4.有我认为我满意的回答我会加分。 展开
4个回答
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Shell("Explorer.exe c:\", AppWinStyle.NormalFocus)
End Sub
Shell("Explorer.exe c:\", AppWinStyle.NormalFocus)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个有帮助吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private counters As PerformanceCounter() = New PerformanceCounter(System.Environment.ProcessorCount - 1) {} '获取CPU个数,如果双核的话有两个
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
For i As Integer = 0 To counters.Length - 1
counters(i) = New PerformanceCounter("Processor", "% Processor Time", i.ToString())’取得CPU使用率
Next
End Sub
'显示
Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
For i As Integer = 0 To counters.Length - 1
Dim f As Single = counters(i).NextValue()
textBox1.Text += "CPU-" + i + ":" + f + "" & Chr(13) & "" & Chr(10) & ""
Next
System.Threading.Thread.Sleep(1000)
End Sub
End Class
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private counters As PerformanceCounter() = New PerformanceCounter(System.Environment.ProcessorCount - 1) {} '获取CPU个数,如果双核的话有两个
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
For i As Integer = 0 To counters.Length - 1
counters(i) = New PerformanceCounter("Processor", "% Processor Time", i.ToString())’取得CPU使用率
Next
End Sub
'显示
Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
For i As Integer = 0 To counters.Length - 1
Dim f As Single = counters(i).NextValue()
textBox1.Text += "CPU-" + i + ":" + f + "" & Chr(13) & "" & Chr(10) & ""
Next
System.Threading.Thread.Sleep(1000)
End Sub
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询