I needed to implement a kill process into my workflow and was able to do it by using the For each loop logic and know how it works. As well I found another tutorial on YouTube where the guy explained it, but it was really short and I couldn’t understand the piece of code he used.So he did assign a code snipped to variable. The code snipped is below:
(From p As Process In process.GetProcesses Where p.ProcessName.ToUpper Like processName.ToUpper And Not GetAllRunningProcesses.Contains(p))(0)
Fine
this is actually a LINQ query where we are trying to get the process names of those process that are running currently inthe background
like
Taking p as a variable that stores the final value of processes
getting all the process names that are running in background with GetProcesses method
this is a where condition similar to how we use in SQL or other querying statements which states that the value of p is like processName.ToUpper (converting to upper)
this is done to obtain only the processname which are in upper case
i didnt get this as some junks mentioned and i hope it is checking for the process apart from the one that contains certain term or a string in it
and finally (0)
this mentions that we are trying to get the first value out of this LINQ query