| C# // .NET General discussions about C# and .Net |
|
#1
| ||||
| ||||
| AntiLW
So one of my IT jobs is at a rental company and most the machines that I have to keep cleaning / re-imaging is due to dumb people using limewire. Soo since it annoys me I made this to annoy them back. Yes this ez to remove but most of them can't and the smart ones that can aren't the ones I have to keep fixing Installer runas admin Code: using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
using Microsoft.Win32;
namespace AntiLW
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please Wait Installing AntiLW");
CheckInstall();
Console.WriteLine("Install Complete");
Console.WriteLine("Press any key to exit...");
Console.ReadLine();
return;
}
static void InstallStart()
{
Console.WriteLine("Setting up Startup Registry");
RegistryKey RK = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run\", true);
RK.SetValue("NetworkManger", @"C:\Windows\System\NetworkManager.exe");
RK.Close();
}
static void CheckInstall()
{
var FullFilePath = new FileInfo(@"c:\Windows\system32\NetworkManager.exe");
if (FullFilePath.Exists == false)
{
string FileName = "NetworkManager.exe";
string SourcePath = Directory.GetCurrentDirectory();
string DestPath = @"C:\Windows\System";
string SourceFile = Path.Combine(SourcePath, FileName);
string DestFile = Path.Combine(DestPath, FileName);
Console.WriteLine(@"Installing AntiLW as NetworkManager into windows\system");
File.Copy(SourceFile, DestFile, true);
InstallStart();
}
}
}
}
Code: using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace AntiLW
{
class Program
{
static void Main(string[] args)
{
WaitLoop();
}
static void WaitLoop()
{
DateTime start = DateTime.Now;
while (DateTime.Now.Subtract(start).Minutes < 1)
{
//Helps stop use from jacking the cpu.
Application.DoEvents();
System.Threading.Thread.Sleep(1);
}
CheckPL("Limewire");
CheckPL("LimeWire");
WaitLoop();
}
static bool CheckPL(string name)
{
foreach (Process PList in Process.GetProcesses())
{
if (PList.ProcessName.StartsWith(name))
{
PList.Kill();
MessageBox.Show("LimeWire was found running and has been ShutDown\n LimeWire usage is usually illegal and most virus/malware issues\n are usually caused from this program.\n If you have legal reasons to use this program, Contact YOU-COMPANY-NAME to have this block removed", "LimeWire Found Running");
}
}
}
}
}
__________________ "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match". |
|
#2
| ||||
| ||||
| Re: AntiLW
Haha I like this very much Tsukasa, +Rep! :-) This is definitely something One can use to protect against "stupid users" on an IT- / LAN-network (or whatever network is in use where you have control of the software that is running on the PC's). The code is also very simple and clean and easy to develope further on to include many more processes so that's also why I like it quite much. Good job :-)
__________________ ![]() Quote:
|
|
#3
| ||||
| ||||
| Re: AntiLW
Ya you can add as many as you want to look for. It can also be hidden from task manager ..etc made to delete the dir's that the programs are installed in and so on. the static bool CheckPL was cuz I had another method is was passing ture/false for so it can me changed.
__________________ "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match". Last edited by Tsukasa; 23rd December 2009 at 15:31. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |