DOM Inspector Tool in FireFox

DOM Inspector Tool in FireFox

Those of you developing extensive JavaScript or UI based web-based applications would have encountered and spent most of the time in creating alert to see if a div exists and document.getElementById (width) etc.

Just was trying out FireFox (same as Netscape family, I hope).

It has a real cool tool embedded called DOMInspector, which aides in inspecting the DOM Structure of the URL that is being viewed.

Check out FireFox at: http://www.mozilla.org/products/firefox/ 


/* Migrated from Daffodilnet Express – posted on December 3, 2005 */

Working with System.Web.Mail namespace…

Working with System.Web.Mail namespace…

We use System.Web.Mail namespace to send emails from our .NET Applications. It uses two main classes called MailMessage and SmtpServer. The latter having a single static property to indicate the email server (smtp host) to use and a public method taking an instance of MailMessage carrying the mail to be delivered.

Internally it is supposed to be a wrapper on the CDO Object and lot of P/Invoke stuff being builtin, the exception stack too can be significantly larger. Quite interestingly, there is one website called http://www.systemwebmail.com/ which I would like to share with the readers which discusses at length, System.Web.Mail namespace, FAQ etc.


/* Migrated from Daffodilnet Express – posted on 11th December 2005 */

Managing Remote Terminal Sessions — The Easy Way

Managing Remote Terminal Sessions — The Easy Way

Windows 2000 brought in an elegant way of working on remote desktops by the concept of Terminal Services. But it was an additional Windows component that needed to be installed and configured, which meant additional license costs and administerial functions to setup and followup. However, it did gain in a perspective that the dependency on a third party application be it commercialware (like pcAnywhere etc) or an opensource (VNC, RealVNC etc) was broken down.

Windows XP took this one step ahead with the concept of Remote Desktop by way of RDP protocol. However, it allowed only one user to work on the system, transferring the control appropriately.

I have been using Windows 2000 Terminal Services for a long long time and one daunting and nightmarish problem that I had to face is that to ensure that users logoff rather than disconnect. When you disconnect a session, Windows Terminal Services remembers this and prevents any new users from opening a connection unless the free sessions are available. The default session count, I guess, is 2 for Windows Terminal Services.

Last week, while casually surfing the web, I came across two nice tools to manage this scenario:

  1. qwinsta.exe:  Displays information about Terminal Sessions
  2. rwinsta.exe: Resets the session subsystem hardware and software to default values. Effectively, you can use this tool to reset disconnected users so that other users can login.

From a developer’s perspective, I feel, that we can have a simple Windows Form application in C# to manage these. Perhaps this weekend, I would try to get a small application and publish it over my personal website for other readers’ use.

From C#, we just need to use WTSAPI32.dll using DllImport to manage the functionalities of QWInsta and RWInsta. More information about this tool over here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/run_time_linking_to_wtsapi32_dll.asp


/* Migrated from Daffodilnet Express – posted on January 1, 2006 */

Developing Applications for the Web is a breeze with Internet Explorer Developer Toolbar…


Developing Applications for the Web is a breeze with Internet Explorer Developer Toolbar…


Debugging a web application, particularly its HTML counterpart like image path, Stylesheet, Scripting and design template issues has always been a nightmare for web developers and this always never fails to spark off arguments between the designers of the team, who would be stubborn for look and feel and developers reluctant to apply apprehending the implementation difficulties and browser compatibility issues.


There had been little tools to this perspective from various vendors like DOMInspector from Mozilla FireFox, MyIE2 had its own Scripting Inspector.


Now you can check out an Internet Explorer Developer Toolbar from Microsoft, which is available from this URL: http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en.


However,  please take note of the following:


  1. The Toolbar is still in BETA stage.
  2. The Toolbar gets installed only if IE 6 is installed.

/* Migrated from Daffodilnet Express – posted on February 22, 2006 */

Clearing IE Cache

Clearing IE Cache

Cache — the five letter buzz word remains as a double-edged sword. System Administrators and Network Administrators appreciate it and recommend it for simple reason, that network bandwidth is conserved. Developers, to an extent blame it since sometimes Old data crops up.

There has been a lot of programmatic options we stipulate from our webpages to clear cache like Pragma, Cache-Control directives.

Here comes one solution from Microsoft called ClearCache. Check it out at: http://www.microsoft.com/downloads/details.aspx?familyid=5CBD4659-3B28-4801-8729-05335902CE79&displaylang=en


/* Migrated from Daffodilnet Express – posted on February 2, 2006 */

Access to the path containing ‘hash.web’ is getting denied.

 


Access to the path containing ‘hash.web’ is getting denied.


After installing Visual Studio .NET and F5 a couple of times, I used to get this error frequently. The only resolution was to wait for upto 5 to10 mins or restart system, since a folder in Temporary ASP.NET files containing web.config gets locked up automatically.


After searching a while in KBs, Forums, I found one closest matching solution, which solved my problem. Just wanted to share with other readers who would also be experiencing this issue. The problem occurs significantly if you touch web.config and ASP.NET has significant memory consumption (as seen in Windows Task Manager)


There is a service called Indexing Service which runs in the system. During F5, ASP.NET tries to JIT compile the new dll (as my understanding goes) and when simultaneously ASP.NET and Indexing service goes to the specified set of cache files, the deadlock occurs and ASP.NET throws this exception.


Solutions:


  • Keep Indexing Service Manual or Stop It
  • In Indexing Service Preferences, Make C:/Winnt/Microsoft.NET to be excluded or placed in the exclusion catalog so that Indexing Service will not access this location.

/* Migrated from Daffodilnet Express – posted on October 15, 2004 */

Quick Shortcut to Lock Workstation

Quick Shortcut to Lock Workstation

We normally use QuickLaunch bar in System Taskbar for almost any of our tasks. When we want go away from our system, we normally lock the workstation. Just a curious tip. A simple two three lines of code in C# can place a nice application whose shortcut can be placed in QuickLaunch bar to Lock the Workstation.

Console Version

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace QuickLock
{

       class MyComputerLock
      {
            [DllImport("user32.dll")]
            public static extern void LockWorkStation();

             static void Main(String[] args)
            {
                     try
                          {
                                 LockWorkStation();
                          }
                          catch (Exception ee)
                         {
                               MessageBox.Show(ee.Message);
                          }
              }
       }
}

Alternatively,if you put the code in Windows Form and you can customize the App.ICO to some friendly ICO file which will showup in QuickLaunch bar instead of the old rectangle which shows up for an EXE.


/* Migrated from Daffodilnet Express – posted on October 15, 2004 */

Time Synchronizations in Windows

Time Synchronizations in Windows


Recently one of my components that I was developing was DateTime driven and hence I had to change system time to see its behavior for different periods. The problem is that, you need to be very careful with changed system times, particularly when you checkin the file to SourceSafe, SendMails since a wrong time means total chaos for these systems.


For these, I choose to have a simple batch file to syncrhonize time with the SourceSafe database itself. It just goes like this:


net time \\mysourcesafeserver  /set /y


net time \\mysourcesafeserver queries the time on the server
/set sets the time on the localhost to the time on the server (This will wait for a prompt of confirmation from the user, which can be avoided by appending a /y to the command)


But I have a question. Perhaps if some sysadmin drops by this post, he can put a comment and solve this so that it will be useful to other readers.


  1. What happens if the logged on user does not have privileges to set time? He is getting Access is denied.
  2. With Windows XP (Time Synchryonization) itself, will the problem in (1) get solved?
  3. To query net time \\mysourcesafeserver one must be logged on to \\mysourcesafeserver previously either my remembered network connection or previous manual logon? Is there any other solution for this?

But I hope the above batch file would be useful to many developers playing with and developing DateTime driven components.


/* Migrated from Daffodilnet Express – posted on October 15, 2004 */

PDF in .NET

PDF in .NET


A newer and a good utility assembly, which I found, which could manage and generate PDF documents on the fly with simple code in C# and .NET. Check out http://itextsharp.sourceforge.net/ . It just contains a simple DLL that need to referenced from your solution, which does all the magic.


/* Migrated from namespace LavanyaDeepak – posted on November 2, 2005 */