Imports System.Text Imports System.Management Public Class Form1 Public Shared Function getApplications() As String Dim a As New StringBuilder() Dim b As New Process() For Each b In Process.GetProcesses(".") Try If b.MainWindowTitle.Length > 0 Then a.Append("Window Title: " + b.MainWindowTitle.ToString() + Environment.NewLine) a.Append("Process Name: " + b.ProcessName.ToString() + Environment.NewLine) a.Append(Environment.NewLine) End If Catch End Try Next Return a.ToString() End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click TextBox1.Text = getApplications() End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Shared Function getApplications() As String Dim a As New StringBuilder() Dim b As New Process() For Each b In Process.GetProcesses(".") Try If b.MainWindowTitle.Length <> "" Then a.Append("Window Title: " + b.MainWindowTitle.ToString() + Environment.NewLine) a.Append("Process Name: " + b.ProcessName.ToString() + Environment.NewLine) a.Append(Environment.NewLine) End If Catch End Try Next Return a.ToString() End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click TextBox1.Text = getApplications() End Sub