-
**:under command1
shell " /c shutdown -s -f -t 0", ** under 0command2.
unload me
-
1 All glngwhichwindows32 = mlngwindowsnt is to judge the system platform, whether it is NT system.
NT system uses AdjustToken to obtain permission verification.
shutdown uses the shutdown parameter ?
Usage: shutdown [-i |.] l | s | r | a] [f] [m \\computername] [t xx] [c "co
mment"] [d up:xx:yy]
There is no parameter to display this message (with ?.)Same)
i Displays the GUI interface, which must be the first option.
l Log out (cannot be used with option -m).
s shut down this computer.
r Shut down and restart this computer.
a Abandon system shutdown.
m computername remote computer shutdown reboot give up.
The timeout for the t xx setting to turn off is xx seconds.
c "comment"Turn off comments (up to 127 characters).
f Force running applications to close without warning.
d [u][p]:xx:yy Reason for closure**.
u is the user**.
p is a planned closure**.
xx is a major reason** (a positive integer less than 256).
yy is a secondary reason** (a positive integer less than 65536).
-
shell "cmd /c shutdown -u -t 1"
Call the cmd implementation.
It turns off after 1 second.
v = msgbox("Are you sure you want to shut it down? ", vbyesno + vbquestion, "???") 'A yes and no dialog box pops up.
if v = vbyes then 'If the click is if glngwhichwindows32 = mlngwindowsnt then'External view, such as equal.
adjusttoken 'External procedures or functions.
end if
shell "cmd /c shutdown -u -t 1" 'Shut down after 1 second after calling cmd.
end if
-
You don't need an API, you just need a shell.
private sub form_laod()shell("shutdown -s -t 300")'300 seconds shutdown end sub
-
Hehe,You can also program this program.,I've learned VB for so many years.,It's used to do management systems and**,Hehe, I haven't really done the operating system tools.
-
First, declare the API function ExitWindowEx:
declare function exitwindowex lib "user32"(byval uflags as long,byval swreserved as long)as long
The shutdown is exitwindowex(ewx shutdown,0) and the reboot is exitwindowex(ewx reboot,0)example:
private sub shut_click()dim abc as long
unload me
abc = exitwindowex(ewx_shutdown,0)end sub
-
if msgbox("Are you sure you want to shut it down? ", vbokcancel + vbquestion, "System Information") = vbok then
shell "cmd /c shutdown -u -t 1", vbnormalfocus
end if
-
Simple:
Inside the shutdown it is written: shell"cmd /c shutdown /s /t 0", vbhide
Restart it and write :shell"cmd /c shutdown /r /t 0", vbhide
Inside the logout writes: shell"cmd /c shutdown /l /t 0", vbhide
-
You can call the shutdown command, first of all, you open the three bat files of Notepad, including "shutdown", "restart" and "logout", for example: save them as follows: ,
Write ** in Notepad as follows (write in three Notepads and then save as):
Logout: shutdown -l
Shutdown: shutdown -s
Restart: shutdown -r
Above, when used, it is directly called with the shell, such as the shutdown command, **is:
private sub command1_click()shell"d:\"'Write which path exists.
end sub
-
This requires the use of api functions, it is recommended to read similar tutorials, or leave an email, and I will send you a copy of what I did before.
Insert 3 texts, 1 command
private sub form_load()= "1000" 'Blood volume. >>>More
Parameter description: rndnumcount, the number of 6 digits; mysearchnum, the number to look for. >>>More
Because the class hasn't been initialized yet.
class1 has a property called c2, and the type is class2; There is a property called integer, and the type is integer; >>>More
i=1,j=1:x(1,1)=x(0,0)+1+1=2i=1,j=2:x(1,2)=x(0,1)+1+2=3...
i=1,j=5:(x,5)=x(0,4)+1+6=6--- >>>More
option explicit
dim x as control >>>More