/********************
Cds.exe can be downloaded from csdn!
Http://download.csdn.net/source/3317043
Attachment Source: http://home.no/aksoftware/ 3rd, qres
********************/
Import java. Io. ioexception;
/**
*
* Modify resolution
* @ Author cmxie
*/
Public class changedisplaysettings {
Public static Boolean change (int w, int H)
{
String cmd = "";
Try {
If (windowsorlinux. getsystemtype () {// judgment system: Window System
// The attachment is the cds.exe file. This file is a small tool for encapsulated resolution modification. Directly call the input parameter.
Cmd = "cmd" + system. getproperty ("user. dir") + "/downloadfilelist/source/cds.exe/X" + W + "/y" + h;
Runtime.getruntime(cmd.exe C (CMD );
Return true;
} Else {// Linux System
// Use the xrandroid command in Linux to modify the resolution
Cmd = "xrandroid-s" + W + "X" + h;
Runtime.getruntime(cmd.exe C (CMD );
Return true;
}
} Catch (ioexception e ){
E. printstacktrace ();
Return false;
}
}
Public static void main (string [] ARGs) throws nativeexception, illegalaccessexception {
Changedisplaysettings. Change (1440,900 );
}
}
/**
* Determine the Operating System
* @ Author cmxie
*
*/
Public class windowsorlinux {
/**
* Obtain the operating system type. Optional values: true: Windows, false: Linux.
* @ Return
*/
Public static Boolean getsystemtype ()
{
String osname = system. getproperty ("OS. Name ");
If (osname! = NULL &&! "". Equals (osname )){
If (osname. Matches ("^ (? I) windows. * $ ") {// Window System
Return true;
} Else
{
Return false;
}
}
Return true;
}
}
/**************** Java storm * 63353324 Technology Alliance **************** ***/