Question:You are creating an application that lists processes on remote computers. The application
requires a method that performs the following tasks: Accept the remote computer name as a string
parameter named strComputer. Return an ArrayList object that contains the names of all processes that
are running on that computer. You need to write a code segment that retrieves the name of each process
that is running on the remote computer and adds the name to the ArrayList object. Which code segment
should you use? - (VB.Net) 

A Dim al As New ArrayList()
Dim procs As array(Of process) = Process.GetProcessesByName(strComputer)
For Each proc As Process In procs
al.Add(proc)
Next 

B Dim al As New ArrayList()
Dim procs As array(Of process) = Process.GetProcesses(strComputer)
For Each proc As Process In procs
al.Add(proc)
Next 

C Dim al As New ArrayList()
Dim procs As array(Of Process) = Process.GetProcessesByName(strComputer)
For Each proc As Process In procs
al.Add(proc.ProcessName)
Next 

D Dim al As New ArrayList()
Dim procs As array(Of Process) = Process.GetProcesses(strComputer)
For Each proc As Process In procs
al.Add(proc.ProcessName)
Next 

+ Answer
+ Report
Total Preview: 1023

Copyright © 2024. Powered by Intellect Software Ltd