devxlogo

Tip Bank

Use Stringbuffer When Appending to Strings

In Java, Strings are immutable objects. This means that they cannot be modified in any way after they are created. When you attempt to modify a String object, you often

Writing Objects To Files

For a number of reasons, you might need to write an object to a file for future usage. Perhaps your applet needs to keep some sort of “state” and between

Determining the Operating System at Runtime

The following java code allows you to identify the operating system on which your application is running: class OperatingSystem{ public static void main(String args[]) { System.out.println (“Operating system : “

Code to Restart or Shut Down Your System

There are lots if times when the system needs to be restarted, for example, after changing the autoexec.bat path. Here is code you can use, in the place of writing

SetIEToolbarPicture – Change IE toolbar image

‘ Set the path of the picture used as background of the IE5/5.5 toolbar’ Note: requires the SetRegistryValue, CheckRegistryKey and CreateRegistryKey ‘ routines, you can find them in the CodeBank’

GetIEToolbarPicture – The path of IE toolbar image

‘ Get the path of the picture used as background of IE 5/5.5 toolbar’ Note: requires the GetRegistryValue routine, you can find it in the CodeBank’ Example:’ MsgBox GetIEToolbarPicturePublic Function

ClearIEHistory – Clear Internet Explorer history

‘ Clear the IE History’ Notes:’ This routine requires the DeleteRegistryKey and CreateRegistryKey routines,’ you can find them in the CodeBankPublic Sub ClearIEHistory() Const HKEY_CURRENT_USER = &H80000001 Dim sKey As