Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-02-2008, 04:33 PM   #1
Baseband Member
 
Join Date: Jan 2008
Posts: 49
Default C# Help

I'm trying to make a small application with a GUI interface (rather than a batch file) so that i can shutdown computers in my classroom when i need to get my students attention. I know the command prompt commands, is there a way to link them to buttons in a C# program?
__________________

dennis72 is offline   Reply With Quote
Old 03-02-2008, 06:06 PM   #2
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: C# Help

Do you want to shut it down from your computer? I know how to implement the command for shutdown in C++. I just don't know how to make it so you can run the program on your computer to shut it down on another. Not much of a help I guess. I think there are programs out there that let you turn the screen black an they can't use their mouse or anything. At the library at my school that's what they have. A black screen that says "Don't play games during school day". They can disable and enable it whenever. I could try to get it for you if you want.
__________________

JogaBonito1502 is offline   Reply With Quote
Old 03-03-2008, 11:06 AM   #3
Fully Optimized
 
ace777's Avatar
 
Join Date: Nov 2006
Posts: 3,110
Default Re: C# Help

you can already do that with remote desktop right?
__________________
2.4 Ghz celeron, 1.25 PNY pc 2700 RAM,PNY VERTIGO 5200 FX , 40 GB HDD
900Mhz 256 RAM , MX 4000, 30 GB HDD
1.9Ghz dual core AMD Athlon 2 GB 384 VRAM 320 Gb HD
2.3 tricore phenom,2 GB RAM , EVGA 9600 GSO,250 GB SSD
2.6 X4 620, 4GB RAM, 9600 GSO, 500 GB HDD/I'm part of The Project
ace777 is offline   Reply With Quote
Old 03-03-2008, 03:52 PM   #4
Baseband Member
 
Join Date: Jan 2008
Posts: 49
Default Re: C# Help

I want to assign shutdown commands to buttons, so that i can click the button rather than type the command. It is always going to be the same computers
dennis72 is offline   Reply With Quote
Old 03-03-2008, 04:53 PM   #5
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: C# Help

Oh ok. I think I understand. You want it to be placed on each computer rather than on yours. I know how you can make a file (.exe), and then make it permanent (alt+0255). The code is super easy.

for C++:
system("shutdown -s -t [time] -c '[caption]'");
to cancel:
shutdown -a on run
JogaBonito1502 is offline   Reply With Quote
Old 03-04-2008, 02:56 PM   #6
Daemon Poster
 
xtremezx2's Avatar
 
Join Date: Sep 2006
Posts: 915
Default Re: C# Help

Give this a try, just off the top of my head, might need some work because I don't remember everything exactly for the cmd line part.

Code:
        
System.Diagnostics.Process proc = new System.Diagnostics.Process();
string compName = "RemoteComp";
string strCmdLine = "/C shutdown -s -t:0 -m \\" + compName;
proc.EnableRaisingEvents = false;
System.Diagnostics.Process.Start("CMD.exe",strCmdLine);
proc.Close();
__________________

xtremezx2 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:58 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0