附錄一 系統資訊一覽,轉貼自http://java.sun.com/j2se/1.4.2/docs/api/java/lang/
System.html#getProperties()
---------------------------------------------------------------------------
顯示使用者名稱、所使用的目錄資料夾及目前執行的資料夾
---------------------------------------------------------------------------
public class SystemInfo {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("The name of account name user: " +
System.getProperty("user.name"));
System.out.println("The home directory of user : " +
System.getProperty("user.home"));
System.out.println(" The current working directory of the user: "
+
System.getProperty("user.dir"));
}
執行結果
---------------------------------------------------------------------------
The name of account name user: 97100632
The home directory of user : C:\Documents and Settings\97100632
The current working directory of the user: C:\Documents and Settings
\97100632\workspace2\Applet
---------------------------------------------------------------------------
附錄一
---------------------------------------------------------------------------
Key (屬性類型) Description of Associated Value
java.version Java Runtime Environment version
java.vendor Java Runtime Environment vendor
java.vendor.url Java vendor URL
java.home Java installation directory
java.vm.specification.version Java Virtual Machine specification version
java.vm.specification.vendor Java Virtual Machine specification vendor
java.vm.specification.name Java Virtual Machine specification name
java.vm.version Java Virtual Machine implementation version
java.vm.vendor Java Virtual Machine implementation vendor
java.vm.name Java Virtual Machine implementation name
java.specification.version Java Runtime Environment specification version
java.specification.vendor Java Runtime Environment specification vendor
java.specification.name Java Runtime Environment specification name
java.class.version Java class format version number
java.class.path Java class path
java.library.path List of paths to search when loading libraries
java.io.tmpdir Default temp file path
java.compiler Name of JIT compiler to use
java.ext.dirs Path of extension directory or directories
os.name Operating system name
os.arch Operating system architecture
os.version Operating system version
file.separator File separator ("/" on UNIX)
path.separator Path separator (":" on UNIX)
line.separator Line separator ("\n" on UNIX)
user.name User's account name
user.home User's home directory
user.dir User's current working directory
沒有留言:
張貼留言