發表文章

目前顯示的是 1月, 2012的文章

How to logmein to Computer without User Password Set

How do I create/remove an Access Code? LogMeIn requires the use of a password.  If you do not have one, you can create one.  In order to do this, you should be physically sitting at the computer where LogMeIn is installed. How do I create an Access Code (LogMeInRemoteUser)? Open the Run box by holding down the Windows logo key and pressing the letter 'R' on your keyboard. Type the following: On Windows XP, Vista, 7: control userpasswords2 . On Windows 2000: control userpasswords . The Windows User Accounts screen appears. Click the Add button. In the user name box, type exactly: LogMeInRemoteUser   and click Next . In the password screen set a password that is at least 8 characters long, keep in mind that it is case sensitive.  This password will be the Access Code.  Select Next . You will be asked "What Level of Access do you want to Grant this User?"  Select Other and make sure the word Administrator is selected. In th

Check the host is down or unknow by InetAddress

getByName public static InetAddress getByName ( String  host) throws UnknownHostException Determines the IP address of a host, given the host's name. The host name can either be a machine name, such as " java.sun.com ", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked. For host specified in literal IPv6 address, either the form defined in RFC 2732 or the literal IPv6 address format defined in RFC 2373 is accepted. If the host is null then an InetAddress representing an address of the loopback interface is returned. See RFC 3330 section 2 and RFC 2373 section 2.5.3. Parameters: host - the specified host, or null . Returns: an IP address for the given host name. Throws: UnknownHostException - if no IP address for the host could be found. SecurityException - if a security manager exists an

POI reading password protected excel file

The ways to read Excel 2003(xls) and Excel 2007(xlsx) files are different . 1 2003(xls)   Please use the Biff8EncryptionKey Class to specify the password,and POI can automatically validate whether the specied password is right. and open the excel file.  Example (code)     POIFSFileSystem pois = new POIFSFileSystem (new FileInputStream("test.xls"));     Biff8EncryptionKey .setCurrentUserPassword("password");     HSSFWorkbook book = new HSSFWorkbook( pois );  The method of setCurrentUserPassword is thread safe. 2 2007(xlsx)   The difference with 2007's way is that password validate is not automatical,  Example (code) ->  the Junit test code from POI source package (DecryptorTest.java)     POIFSFileSystem fs = new POIFSFileSystem ( POIDataSamples .getPOIFSInstance().openResourceAsStream("protect.xlsx"));         EncryptionInfo info = new EncryptionInfo(fs);         Decryptor d = new Decryptor(info);         d.verifyPassword(&