Posts Tagged code

ShwetaHow to restart a windows service using VBScript

Thursday, March 4th, 2010

You can restart a windows service with the use of VBScript as shown in the below code snippet:

Set oshell = createobject(”Wscript.Shell“)
oshell.run”
cmd.exe
wscript.sleep
500
oshell.sendkeys “
net stop “”Your service name here“”"+(”{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
net start “”Your service name here“”"+(”{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
exit“+(”{Enter}”)

set oshell = nothing

WScript.Quit

`
http://www.all1press.com

http://www.all1tunes.com

Tags: , , ,
Posted in Editorial, Purely Technical | No Comments »

SuzanneCreating Audio (Sound) Files for a Web Page

Thursday, February 25th, 2010

If you’re using Windows 95+ and have a microphone and speakers, you can create your own audio files to place on your web page.

In Windows XP+, click on “Start” and go to “All Programs” – “Accessories” – “Entertainment” – “Sound Recorder.

In Windows Vista, click on the round Windows logo button on the bottom left hand side of your desktop and go to “All Programs” – “Accessories” – “Sound Recorder.

You can record your own .wav files to be placed within your web page for your visitors to hear.

Once you’ve created your sound file and uploaded it to your server, place the following code within your web page where you would like the control panel to appear. This code is compatible with both Internet Explorer and Netscape Navigator.

<EMBED src=“yourfile.wav” autostart=”false” loop=”false” hidden=”false”>

<noembed>
<bgsound src=”yourfile.wav” loop=”1″> </noembed>

Change the text indicated in red to your sound file.

The “autostart” determines whether or not the sound will play when the page loads. “True” specifies that the sound will start on load and “False” specifies that the sound will not start on load.

The “loop” determines how the sound should be played. “False” specifies that the sound should not loop and will play it through one time. “True” specifies that the sound should loop and play continuously. It is highly recommended that you leave this set on false.

The “hidden” specifies whether or not the music’s control panel should be displayed. “True” specifies that the control panel should be hidden. “False” specifies that the control panel should be displayed. It is highly recommended that you leave this set on false. This will enable your visitors to stop the sound if they prefer.

http://www.all1sourcetech.com

http://www.all1martpro.com

Tags: , , , , , , , ,
Posted in Opensource, Purely Technical | No Comments »

NaggieHow do you clear the browser cache in jsp?

Thursday, February 18th, 2010

Often referred to as the cache, the Temporary Internet Files folder contains a kind of travel record of the items you have seen, heard, or downloaded from the Web, including images, sounds, Web pages, even cookies. Typically these items are stored in the Temporary Internet Files folder.

Storing these files in your cache can make browsing the Web faster because it usually takes your computer less time to display a Web page when it can call up some of the page’s elements or even the entire page from your local Temporary Internet Files folder.

All those files stored in your cache take up space, so from time to time, you may want to clear out the files stored in your cache to free up some space on your computer. This is called clearing the cache.

You have to implement the following code at top of the .jsp page.

You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser.

Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.

<% response.setHeader(”Cache-Control”,”no-cache”); //HTTP 1.1

response.setHeader(”Pragma”,”no-cache”); //HTTP 1.0

response.setDateHeader (”Expires”, 0); //prevents caching at the proxy server %>

http://www.all1sourcetech.com

http://www.all1martpro.com

Tags: , , , , , ,
Posted in Sun Technology | No Comments »