C # version Avira local/remote process tools

Source: Internet
Author: User

Xkill [Original]

Author:r&s

e-mail: [Email protected]

HomePage:fz5fz.yeah.net

date:10/04/2003

Using System;

Using System.Management;

Using System.Threading;

Class Xkill

{

public static void usage ()

{

Console.WriteLine ();

Console.WriteLine ("Xkill v1.0 Beta, by R&s");

Console.WriteLine ("E-mail: [email protected]");

Console.WriteLine ("H-page:http://fz5fz.yeah.net");

Console.WriteLine ();

Console.WriteLine ("Usage:xkill [IP] [account] [password] [programme] [Time (s)]");

Console.WriteLine ("If its the Localhost,dont need account and password");

Console.WriteLine ("Example:xkill 218.194.x.x Administrator 123 qq.exe 60");

Console.WriteLine ("Xkill 218.194.x.x Administrator NULL qq.exe 60");

Console.WriteLine ("Xkill 127.0.0.1 qq.exe (for localhost)");

}

public static void Main (string[] args)

{

if (args. length!=5) && (args. length!=3))

{

Usage ();

Environment.exit (0);

}

while ((args[0]== "127.0.0.1") ││ (args[0]== "192.168.0.1"))

{

String killname=args[1];

ManagementObjectSearcher link = new ManagementObjectSearcher ("SELECT * from Win32_Process");

Managementobjectcollection Collection = link. Get ();

foreach (ManagementObject Process in Collection)

{

Console.WriteLine ("{0} {1}", Convert.ToString (process["Name"]). PadRight (), process["ExecutablePath"]);

if (convert.tostring (process["Name"]) ==killname)

{

String[] Tparas = {"1"};

Process.invokemethod ("Terminate", Tparas);

}

}

Console.WriteLine ();

Console.WriteLine ("Terminate It Yet");

Thread.Sleep (Convert.ToInt32 (args[2]) *1000);

}

try{

Do

{

String killname=args[3];

ConnectionOptions Conn = new ConnectionOptions ();

Conn.username =args[1];

if (args[2]== "NULL")

{

Conn.password = "";

}

else Conn.password =args[2];

Managementpath p = new Managementpath ("\ \" +args[0]+ "\root\cimv2");

Managementscope ms = new Managementscope (p,conn);

ObjectQuery OQ = new ObjectQuery ("SELECT * from Win32_Process");

ManagementObjectSearcher link = new ManagementObjectSearcher (MS,OQ);

Managementobjectcollection Collection = link. Get ();

Console.WriteLine ("--------------------------------------------------------");

foreach (ManagementObject Process in Collection)

{

Console.WriteLine ("{0}{1}", Convert.ToString (process["Name"]). PadRight (), process["ExecutablePath"]);

if (convert.tostring (process["Name"]) ==killname)

{

String[] Tparas = {"1"};

Process.invokemethod ("Terminate", Tparas);

}

}

Thread.Sleep (Convert.ToInt32 (args[4]) *1000);

}while (TRUE);

}

catch (Exception exobj)

{

Console.WriteLine ();

Console.WriteLine ("failed!");

Console.WriteLine (Exobj.message);

}

}

}

Xkill [Original]

Author:r&s

e-mail: [Email protected]

HomePage:fz5fz.yeah.net

date:10/04/2003

Using System;

Using System.Management;

Using System.Threading;

Class Xkill

{

public static void usage ()

{

Console.WriteLine ();

Console.WriteLine ("Xkill v1.0 Beta, by R&s");

Console.WriteLine ("E-mail: [email protected]");

Console.WriteLine ("H-page:http://fz5fz.yeah.net");

Console.WriteLine ();

Console.WriteLine ("Usage:xkill [IP] [account] [password] [programme] [Time (s)]");

Console.WriteLine ("If its the Localhost,dont need account and password");

Console.WriteLine ("Example:xkill 218.194.x.x Administrator 123 qq.exe 60");

Console.WriteLine ("Xkill 218.194.x.x Administrator NULL qq.exe 60");

Console.WriteLine ("Xkill 127.0.0.1 qq.exe (for localhost)");

}

public static void Main (string[] args)

{

if (args. length!=5) && (args. length!=3))

{

Usage ();

Environment.exit (0);

}

while ((args[0]== "127.0.0.1") ││ (args[0]== "192.168.0.1"))

{

String killname=args[1];

ManagementObjectSearcher link = new ManagementObjectSearcher ("SELECT * from Win32_Process");

Managementobjectcollection Collection = link. Get ();

foreach (ManagementObject Process in Collection)

{

Console.WriteLine ("{0} {1}", Convert.ToString (process["Name"]). PadRight (), process["ExecutablePath"]);

if (convert.tostring (process["Name"]) ==killname)

{

String[] Tparas = {"1"};

Process.invokemethod ("Terminate", Tparas);

}

}

Console.WriteLine ();

Console.WriteLine ("Terminate It Yet");

Thread.Sleep (Convert.ToInt32 (args[2]) *1000);

}

try{

Do

{

String killname=args[3];

ConnectionOptions Conn = new ConnectionOptions ();

Conn.username =args[1];

if (args[2]== "NULL")

{

Conn.password = "";

}

else Conn.password =args[2];

Managementpath p = new Managementpath ("\ \" +args[0]+ "\root\cimv2");

Managementscope ms = new Managementscope (p,conn);

ObjectQuery OQ = new ObjectQuery ("SELECT * from Win32_Process");

ManagementObjectSearcher link = new ManagementObjectSearcher (MS,OQ);

Managementobjectcollection Collection = link. Get ();

Console.WriteLine ("--------------------------------------------------------");

foreach (ManagementObject Process in Collection)

{

Console.WriteLine ("{0}{1}", Convert.ToString (process["Name"]). PadRight (), process["ExecutablePath"]);

if (convert.tostring (process["Name"]) ==killname)

{

String[] Tparas = {"1"};

Process.invokemethod ("Terminate", Tparas);

}

}

Thread.Sleep (Convert.ToInt32 (args[4]) *1000);

}while (TRUE);

}

catch (Exception exobj)

{

Console.WriteLine ();

Console.WriteLine ("failed!");

Console.WriteLine (Exobj.message);

}

}

}

C # version Avira local/remote process tools

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.