我在这段代码中遇到了一个异常:
Imports System.Windows.Forms
Imports System.Text
Imports System.Diagnostics
Public Class MDIParent1
Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
getapp.getApplication()
End Sub
Public Sub MDIParent1(ByVal value As String, ByVal value1 As String)
Dim ChildForm As New System.Windows.Forms.Form
ChildForm.MdiParent = Me
ChildForm.Text = value1
ChildForm.Show()
End Sub
End Class
Public Class getApplications
Dim w As String
Dim b As New Process()
Dim p As String
Dim mdi As New MDIParent1 'here i am getting exception that is System.StackOverflowException was unhandled InnerException:..
Dim i As Integer
Public Sub getApplication()
For Each Me.b In Process.GetProcesses(".")
Try
If b.MainWindowTitle.Length > 0 Then
p = b.ProcessName.ToString()
w = b.MainWindowTitle().ToString()
mdi.MDIParent1(p, w)
End If
Catch
End Try
Next
End Sub
End Class