March 21, 2001

Deleting Files or FileTypes En Masse

Sometimes you run into a situtation where you want to delete all the files or a particular type of file (like text files – *.txt) in a folder.Here is a

Restrict a Textbox to Accept Only Numbers

Sometimes we may need to restrict users from entering anything besides numbers in a textbox. The following code can achieve this: Option ExplicitPrivate strClipboardText As StringPrivate Sub txtNumberBox_KeyPress(KeyAscii As Integer)

Concatenating Big Strings

Please note that using the join function makes this code VB6 only (for only a small performance gain). dim i as longdim s as stringfor i = 0 to 100000

Determine Whether a User Session Has Expired or Been Removed

Define a class, say SessionTimeoutIndicator, which implements theinterface javax.servlet.http.HttpSessionBindingListener. Next create a SessionTimeoutIndicator object and add it to the user session. When the session is removed, the SessionTimeoutIndicator.valueUnbound() method will