Skip to main content

Posts

Showing posts from December, 2006

Uploading files to the server like GMail and Yahoo Mail

Recently I got to work on a project which needed file uploading just like in GMail and Yahoo Mail. Before proceeding further, I would like to mention that it is not possible to use AJAX to do file uploading to ther server as JavaScript can execute only in the browser and does not have access to the file system. So the technique we employed here is the the hidden IFrame . To make this work we need JavaScript and any server side script. For the demo, I will be using ASP.NET with C# on the server side. Let us delve in to the code without further delay. Step 1: In your web application, create two aspx files UploadTest.aspx and UploadFile.aspx. Step 2: Add this HTML code inside form tag to UploadTest.aspx <table id="tblAttach"> <tr> <!--- This td displays the link Attach File--> <td id="td_upload_attach" style="DISPLAY: block;> </td> <!--This td displays the attaching message while the file is uploading to ther server--> <td

Kill a remote user session remotely

When trying to connect to your Windows 2000/2003 server remotely, you may receive the following error. "The terminal server has exceeded the maximum number of allowed connections." You could kill one or more of those connections by using PsExec tool that can be downloaded from the following link. This tool and a bunch of others were developed by SysInternals which was bought by Microsoft. http://www.microsoft.com/technet/sysinternals/utilities/pstools.mspx Open your command prompt and from the directory that contains the psexec utility, do the following 1) psexec \\x.x.x.x -u user -p password cmd (this will give you access to the cmd prompt on the server) Example: psexec \\127.0.0.1 -u admin -p password cmd 2) once you get the command prompt run the command qwinsta to get a list of all Terminal Services connections. Each connection has an Id Number. 3) Run the command logoff [id# of session to quit] /v (this will kill the connection with that id #) Example: logoff 2 /v Once