Windows 7 (Seven) Shortcuts

Here are few very nice and useful shortcuts available in Microsoft’s latest operating system Windows 7 (Seven):

Win + Home Minimize all the windows except the current window.
Win + SpaceBar Key Visible windows becomes transparent so you can see the desktop.
Win + Up Arrow Maximize the current window.
Win + Shift + Up Arrow Vertically Maximize the current window.
Win + Down Arrow Restore / Minimize the current window.
Win + Left Arrow Fit window in the left half of the screen.
Win + Right Arrow Fit window in the right half of the screen.
Win + Number (1-9) Open the in the order arranged in the taskbar.
Win + Ctrl + Number (1-9) Toggle the opened windows in same order as they are on taskbar
Win + Alt + Number (1-9) Open Jump List of the apps in the same order as they are on taskbar.
Win + T Focus the taskbar buttons to navigate in.
Win + B Focus the System Tray butoms to navigate in.
Ctrl + Shift + N Create New Folder in explorer or desktop.
Alt + Up Arrow Move up a directory level.
Alt + P Open/Close preview pan in explorer.
Win + P Select the display mode if multiple displays are attached.
Win + Num Pad (+/-) Magnifier Zoom In/Out.
Win + G Navigate in Desktop Gedgets
Win + L Lock Computer (old shortcut)
Win + Tab Windows 3D.

Server.MapPath

In general whenever we need to get physical location of the file in ASP.Net Application, we use Server.MapPath. This is the most commonly adopted method. If you want the file to be located with reference to the path of the current WebPage, then the implementation holds good, but, in case you have to always refer the file from the application root, this method gives you different results. Take the following scenario, where the application directory structure is as follows:

  • Root
    • Data
      • Data.XML
    • ClassA.cs (uses Server.MapPath(“\Data\Data.XML”))
    • ClassB.cs (uses ClassA to get the XML file contents)
    • SubDir
      • ClassC.cs (uses ClassA to get the XML file contents)

In the above scenario the ClassC will fail to retrive the contents in case of the WebApplication is hosted in a virtual directory. The application will work fine if it is a website. So the implementation will not show any errors when we run the application from the Visual Studio. to make it more generic we can replace the Server.MapPath with

System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + @”Data\Data.XML”.