JinGanTec Studio@桂花园

大量多年原生桂花树待售中;Coding in Csharp,Ruby,VBS!

导航

Game Monitor main block

/*Wrote by Michael C.,pls. do not modify this code if you are not*/
/*a family in Csharp ! Nov 29 2005 */
using System;
using System.Management;
using System.Diagnostics;
using System.Text.RegularExpressions;
public class QueryProcess02 {
   public static void Main(){
   ManagementObjectSearcher searcher = new
   ManagementObjectSearcher("Select * from Win32_Process");
      foreach (ManagementObject process in searcher.Get())
      { 
       
        //Console.WriteLine("Process Caption: "+ process["Caption"]);
 //Console.WriteLine("Process Description: "+ process["Description"]);
 //Console.WriteLine("Process ExecutablePath: "+ process["ExecutablePath"]);
 //Console.WriteLine("Process handle: "+ process["Handle"]);
 //Console.WriteLine("Process Name: "+ process["Name"]);
 //Console.WriteLine("Process OSName: "+ process["OSName"]);
       
       string[] s= new String[2];
        process.InvokeMethod("GetOWner",(object[])s);
        string prOwner = s[1]+"\\"+s[0];
       
        if (prOwner.Length ==13)
        {//Console.WriteLine(prOwner);
         string prFullPath = process["ExecutablePath"].ToString();
         //Console.WriteLine(prFullPath);
          //prFullPath = "@"+prFullPath;
         // Console.WriteLine("Break Point Test01");
       
        FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"prFullPath");
             
        if (myFileVersionInfo.CompanyName == null) 
               continue;
           }
           else{
            Regex r = new Regex("(]Microsoft]]Kingsoft]Symantec[Oracle]IZSoftware[Adobe]).*");
         if(!r.IsMatch(myFileVersionInfo.CompanyName))
        {
               Console.Write("CompanyName:" + myFileVersionInfo.CompanyName);
        Console.Write("OriginalFileName:" + myFileVersionInfo.OriginalFilename);
        Console.WriteLine("GAME");
              }
              
           
      }
  
    }
 }
}
 
 

posted on 2005-11-29 15:08  Roopeman  阅读(285)  评论(0编辑  收藏  举报