在文本框中显示选定的进程

时间:2019-05-12 22:25:58

标签: vb.net basic

https://i.imgur.com/Tppceyw.png 当我单击选择时,它将打开Form2,其中列出了进程。我应该如何在Form2中选择一个进程,然后在按下选择按钮后在Form1的文本框中显示它?

这就是我获得流程的方式

    Dim plist() As Process = Process.GetProcesses()

    For Each prs As Process In plist
        ListBox1.Items.Add(prs.ProcessName + "         (" + prs.PrivateMemorySize64.ToString() + ")")
    Next

1 个答案:

答案 0 :(得分:0)

想通了 Form2:

Class<?> clazz = Class.forName("Greeter");
Object obj = clazz.getConstructor().newInstance(); // Use default constructor 
Method method = clazz.getMethod("methodName",<array of class objects representing argument types>);
Object result = method.invoke(obj,<array of arguments>);