กรุณาปิด AdBlock!

Cancel your adBlock please.

ขยายหน้าเว็บRegister Login
 โฆษณา
หน้า: [1]  ลงล่าง
  พิมพ์  
topic

ช่วยผมหน่อยครับ ภาษา C  (อ่าน 7062 ครั้ง)

ไอที
« เมื่อ: 31, 01 2012, 07:01:53 PM »
อยากทราบว่าผมจะทำในลักษณะแบบว่า เช่น หาก กด Y แล้วชัตดาวน์ กด A นั้น รีสตารทอะไรประมาณนี้อ่ะคับ
จะเอาไปประยุกต์ใช้ ผมหาเท่าไรก็ไม่เจอ ช่วยผมหน่อยเหอะ 
swict
เด็กไอทีคลับหน้าใหม่
*
พลังความคิด 1
กระทู้: 4
บันทึกการเข้า
ไอที
« ตอบ #1 เมื่อ: 31, 01 2012, 10:06:44 PM »
ลองดูอันนี้
http://www.blurtit.com/q340858.html

Fortunately, "shutdown" is a system command, so it's dead simple to call from C/C++:

system("shutdown -r"); ///note the -r 'restart' option

Here is help on the the command:

C:\shutdown /?
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "c
omment"] [-d up:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without war
ning
-d [p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer le
ss than 256)
yy is the minor reason code (positive integer le
ss than 65536)
เด็กไอทีคลับ
เด็กไอทีตัวพ่อ
เด็กไอทีคลับชั้นเซียน
*
พลังความคิด 89
กระทู้: 3,536
บันทึกการเข้า
หน้า: [1]  ขึ้นบน
  พิมพ์  
 
กระโดดไป: