|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.sfc.Win32.System
public final class System
Used to logoff, reboot, shutdown and poweroff the computer. Also used to specify how errors are handled, to generate a tone on the speaker or play a registered wave sound and to get and set the last error.
Constructor Summary | |
---|---|
System()
|
Method Summary | |
---|---|
static void |
abortSystemShutdown(java.lang.String computer_name)
Attempts to stop the named system from being shutdown or restarted. |
static void |
beep(int type)
Plays the registered wave sound. |
static void |
beep(int frequency,
int duration)
On Windows 9x/Me plays the standard sound and on Windows NT/2000/XP plays a sound of specified frequency and duration on the system's speaker. |
static java.lang.String |
expandEnvironmentVariables(java.lang.String s)
Returns a String with environment variables replaced with associated values. |
static java.lang.String |
getAccountName(java.lang.String domain_name,
java.lang.String sid)
Returns the account name for the given SID from the specified domain name. |
static int |
getBuildNumber()
Returns the build number. |
static java.lang.String |
getCommandLine()
Returns the command line specified to run the current program. |
static java.lang.String |
getComputerName()
Returns the name of the computer. |
static int |
getLastError()
Returns the last error code. |
static int |
getMajorVersion()
Returns major version number. |
static int |
getMinorVersion()
Returns minor version number. |
static int |
getVersion()
Deprecated. This method method has been superseded by getMajorVersion(), getMinorVersion() and getBuildNumber(). |
static void |
logoff(boolean force)
Shutdowns all processes and logs the user off. |
static void |
poweroff(boolean force)
Shutdowns the system and then turns the power off. |
static void |
reboot(boolean force)
Shutdowns all processes and then restarts the computer. |
static void |
reboot(java.lang.String computer_name,
java.lang.String message,
long timeout,
boolean force)
Displays the Reboot dialog for the specified amount of time, then shutdowns all processes and restarts the specified computer. |
static int |
setErrorMode(int mode)
Sets how errors are handled by the system. |
static void |
setLastError(int error_code)
Sets the last error code. |
static void |
shutdown(boolean force)
Shutdowns the system and then turns the power off. |
static void |
shutdown(java.lang.String computer_name,
java.lang.String message,
long timeout,
boolean force)
Displays the Shutdown dialog for the specified amount of time, then shutdowns all processes and shutdowns the specified computer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public System()
Method Detail |
---|
public static final void poweroff(boolean force) throws Win32Exception
Not all systems support power-off.
force
- whether to force the shutdown and power off.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void logoff(boolean force) throws Win32Exception
force
- whether to force the shutdown and user off.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void reboot(boolean force) throws Win32Exception
force
- whether to force the shutdown and restart.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void shutdown(boolean force) throws Win32Exception
force
- whether to force the shutdown and power off.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void reboot(java.lang.String computer_name, java.lang.String message, long timeout, boolean force) throws Win32Exception
Requires Windows NT/2000/XP.
computer_name
- the name of the computer to restart.message
- the message to display.timeout
- the amount of time in seconds to display the message.force
- whether to force the shutdown and restart.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void shutdown(java.lang.String computer_name, java.lang.String message, long timeout, boolean force) throws Win32Exception
Requires Windows NT/2000/XP.
computer_name
- the name of the computer to shutdown.message
- the message to display.timeout
- the amount of time in seconds to display the message.force
- whether to force the shutdown and power-off.
Use only in emergencies. Setting this to true will cause all running applications to be abruptly terminated and may result in data corruption or loss.
Win32Exception
- if any error occurs.public static final void abortSystemShutdown(java.lang.String computer_name) throws Win32Exception
Requires Windows NT/2000/XP.
computer_name
- the name of the computer.
Win32Exception
- if any error occurs.public static final java.lang.String getComputerName() throws Win32Exception
Win32Exception
- if any error occurs.public static final int getVersion()
Platform | High-order bit | Low-order bit |
---|---|---|
Windows NT/2000/XP | 0 | 3, 4, or 5 |
Windows 95/98 | 1 | 4 |
Windows 3.1 with Win32s | 1 | 3 |
public static final void beep(int type) throws Win32Exception
type
- the wave sound defined in BeepType.
Win32Exception
- if any error occurs.public static final void beep(int frequency, int duration) throws Win32Exception
frequency
- the frequency in hertz. A value is the range 37 through 32,767duration
- the duration in milliseconds
Win32Exception
- if any error occurs.public static final int setErrorMode(int mode) throws Win32Exception
mode
- the error mode defined in ErrorMode.
Win32Exception
- if any error occurs.public static final int getLastError()
public static final void setLastError(int error_code)
error_code
- the last error code.public static final java.lang.String getCommandLine()
public static final java.lang.String expandEnvironmentVariables(java.lang.String s) throws Win32Exception
s
- the String to expand.
Win32Exception
- if any error occurs.public static final int getMinorVersion()
public static final int getMajorVersion()
public static final int getBuildNumber()
public static final java.lang.String getAccountName(java.lang.String domain_name, java.lang.String sid) throws Win32Exception
domain_name
- - the name of the domain. null for the local computer.sid
- the SID. In the form: S-revision-identity_authority{-subauthority}...
Win32Exception
- if any error occurs.
|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.