I need to extract a value from a process array to myArray:
File: MyClass.vb
Public Function getTheRunningProcess()
Dim MyArray As Array
For Each prso In Process.GetProcesses(System.Environment.MachineName)
'This is the value i want to extract and put it in a Array
MyArray() = prso.ProcessName.ToString
Next
'Now i need to return the MyArray so i can access its value from anywhere
Return MyArray
End Function
So i can access this value from anywhere like so:
File: Form1.vb
For Each MyValue As TheValueFromFunction_getTheRunningProcess()
Listbox.item.addItem(MyValue)
Next
Now you might be thinking i can directly use the process in the File: Form1.vb but here is the situation, i have to use this function over and over again in different form as the application demands it has to be.
So if this is possible then how?
Or if there is any other way to do this?
Please show me the right path.
Thanks in advance 🙂
You could try doing it with Lists… And then
Hope it helps