Home > Net > The.net framework change Process after class is not normal
The.net framework change Process after class is not normal
Time:10-03
The enumeration process load module information problems Windows 7 operating system. Net4.7, test process QQProtect The same code to create a new project execution no problem, change. The.net framework 4.0 changed, changed back again, only to establish engineering problem.
The code is as follows:
Using System; using System.Collections.Generic; Using System. Diagnostics; Using System. Linq; Using System. The Text; Using System. The Threading. The Tasks;
The namespace testProcess2 { Class Program { The static void Main (string [] args) { Process [] pname=Process. GetProcesses (); //traversal process Foreach (Process p in pname) { //if the process name to find back Try { If (p. ainModule. FileName. ToLower (). The IndexOf (" QQProtect ". ToLower ())!=1) { Console. WriteLine (p. ainModule. FileName + "\ n"); Console. WriteLine (" module number "+ p. odules. Count +" \ n "); For (int I=0; I & lt; P. odules. Count; I++) { Console. WriteLine (p. odules [I] FileName + "\ n"); } Console. WriteLine (" \ n "); } } The catch (Exception) { continue;//traversal process without access when they ran out of the abnormal } } Console.ReadKey(); } } }
Not normal.net framework 4.0
Under the normal.net framework 4.6.1
Normal framework version
CodePudding user response:
I used the.net 4.0 made the acquisition process, didn't meet what problem,