Join 150,390 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,058 people online right now. Registration is fast and FREE... Join Now!
I'm not sure I'm completely understanding your question here. Can you be a little more specific please
Yes I am writing a service app that runs in the background That prevents Users from accessing The fallowing CMD, Control Panel, Installations", Internet, and Task-Manager from inside my app w/o setting User Admin Rights...
How do I do this???
The code I am looking for will be activated by a check-box for each item...
Sorry about the confusion
This post has been edited by ajax-maxx: 27 Feb, 2008 - 02:50 PM
Ok I found two ways of doing this One was to place a registry edit that hooked and unhooked the Processes I wanted to disable... (alot of code)
Then I found this page by PsychoCoder that had this code...
CODE
//Namespaces needed using System.Diagnostics;
public bool FindAndKillProcess(string name) { //here we're going to get a list of all running processes on //the computer foreach (Process clsProcess in Process.GetProcesses) { //now we're going to see if any of the running processes //match the currently running processes by using the StartsWith Method, //this prevents us from incluing the .EXE for the process we're looking for. //. Be sure to not //add the .exe to the name you provide, i.e: NOTEPAD, //not NOTEPAD.EXE or false is always returned even if //notepad is running if (clsProcess.ProcessName.StartsWith(name)) { //since we found the proccess we now need to use the //Kill Method to kill the process. Remember, if you have //the process running more than once, say IE open 4 //times the loop thr way it is now will close all 4, //if you want it to just close the first one it finds //then add a return; after the Kill clsProcess.Kill(); //process killed, return true return true; } } //process not found, return false return false; }
And am wondering if this could be made into a Constant Loop to kill the process everytime its started???
This post has been edited by ajax-maxx: 28 Feb, 2008 - 09:35 AM
CMD, Control Panel, Installations", Internet, and Task-Manager from inside my app w/o setting User Admin Rights...
everyday users should have accesses to them unless you are writing a virus that is the only reason I can see for not allowing access to
QUOTE
CMD, Control Panel, Installations", Internet, and Task-Manager
Yeah I write viruses for a hobby LOL
I am creating a program that allows you (The Admin) to control a computer that has multiple Admin accounts, and multiple users... (One thing I hate about using Limited user accounts is that in order for me to do anything in them I either A. have to log off and do it from my account or B. I have to consistantly put my username and password into a the run as box to preform the tasks that need to be done)...
This program allows me to preform all tasks just by a small shortcut...
This program once set; limits the time that any one person can be logged in, and sets the accounts according to what I will allow. There is a kill key for this program so I can run installs of new programs or other admin tasks for them that key is (alt+ctr+F12) then reset it using (alt+ctr+F11) so they can then play there games...
Here is a Screen shot of the program:
LOL a Managed C# .Net Virus hahaha
Whats up with the forum calling every body a DIC Head???
This post has been edited by ajax-maxx: 29 Feb, 2008 - 10:39 AM
@ajax-maxx: You could put that code inside a timer event that runs in its own thread and set the timers interval to the interval you wish to have it check the list of processes.
@ajax-maxx: You could put that code inside a timer event that runs in its own thread and set the timers interval to the interval you wish to have it check the list of processes.
@ajax-maxx: You could put that code inside a timer event that runs in its own thread and set the timers interval to the interval you wish to have it check the list of processes.
Thanks I'll give it a try...
Ok Here is the code written so far tell me what I did wrong LOL...
private void timer1_Tick(object sender, EventArgs e) } // Name of Process to Kill public bool FindAndKillProcess(string taskmgr) { // Get Processes foreach (Process clsProcess in Process.GetProcesses) { // Check for process Name if (clsProcess.ProcessName.StartsWith(taskmgr)) { // Kill Named clsProcess.Kill(); //process killed, return true return true; } } // process not found, return false return false; } }
bool shows up as Red tagged and it says I am Missing a ; after private void timer1_Tick(object sender, EventArgs e)