Friday, September 30, 2011

Windows Hot Keys

Win Press windows key to open start menu

Win+R Apply to open Run dialog box

Win+M Apply to minimize all opened windows

Win+Shift+M Apply to maximize all opened windows

Win+L Press keys to lock keyboard in windows XP

Win+E Press keys to open My Computer

Win+F Apply to open search options

Win+U Apply keys to open Utility Manager

Win+D To view desktop/minimize all windows

Win+F1 To view the detail windows help page

Win+Pause To view the System Properties dialog box

Win+Tab Move through taskbar programs

Win+F+Ctrl Apply to open search for computers

Alt+Tab Move through opened windows programs

Alt+F4 Press keys to close active windows program

Alt+Enter Apply to open properties of selected item

Alt+ SPACEBAR Open the system menu of active window

Alt+ SPACEBAR +N Press keys to minimize the active program

Alt+ SPACEBAR +R Press keys to restore the active program

Alt+ SPACEBAR+C Press keys to close the active program

Alt+ SPACEBAR+X Press keys to maximize the active program

Alt+ SPACEBAR+M Press keys to move the active program

Ctrl+Alt+Delete Apply to open windows task manager

Ctrl+Shift+Esc Apply to open windows task manager

Ctrl+Esc Press keys to open start menu

Shift Shift key to prevent CD from automatically playing

Shift+Delete To delete items permanently

Thursday, September 22, 2011

Windows Run Commands

Application to OpenRun Command
Accessibility Controls access.cpl
Accessibility Wizardaccwiz
Add Hardware Wizardhdwwiz.cpl
Add/Remove Programs appwiz.cpl
Administrative Toolscontrol admintools
Adobe Acrobat (if installed)acrobat
Adobe Designer (if installed)formdesigner
Adobe Distiller (if installed)acrodist
Adobe ImageReady (if installed)imageready
Adobe Photoshop (if installed)photoshop
Automatic Updateswuaucpl.cpl
Bluetooth Transfer Wizardfsquirt
Calculatorcalc
Certificate Managercertmgr.msc
Character Mapcharmap
Check Disk Utilitychkdsk
Clipboard Viewerclipbrd
Command Promptcmd
Component Servicesdcomcnfg
Computer Managementcompmgmt.msc
Control Panelcontrol
Date and Time Properties timedate.cpl
DDE Shares ddeshare
Device Managerdevmgmt.msc
Direct X Control Panel (if installed)*directx.cpl
Direct X Troubleshooterdxdiag
Disk Cleanup Utilitycleanmgr
Disk Defragmentdfrg.msc
Disk Managementdiskmgmt.msc
Disk Partition Managerdiskpart
Display Propertiescontrol desktop
Display Propertiesdesk.cpl
Display Properties (w/Appearance Tab Preselected)control color
Dr. Watson System Troubleshooting Utilitydrwtsn32
Driver Verifier Utilityverifier
Event Viewereventvwr.msc
Files and Settings Transfer Toolmigwiz
File Signature Verification Toolsigverif
Findfastfindfast.cpl
Firefox (if installed) firefox
Folders Propertiesfolders
Fontscontrol fonts
Fonts Folderfonts
Free Cell Card Gamefreecell
Game Controllers joy.cpl
Group Policy Editor (XP Prof)gpedit.msc
Hearts Card Gamemshearts
Help and Supporthelpctr
HyperTerminalhypertrm
Iexpress Wizardiexpress
Indexing Serviceciadv.msc
Internet Connection Wizardicwconn1
Internet Exploreriexplore
Internet Properties inetcpl.cpl
Internet Setup Wizardinetwiz
IP Configuration (Display Connection Configuration)ipconfig /all
IP Configuration (Display DNS Cache Contents)ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents)ipconfig /flushdns
IP Configuration (Release All Connections)ipconfig /release
IP Configuration (Renew All Connections)ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS)ipconfig /registerdns
IP Configuration (Display DHCP Class ID)ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID)ipconfig /setclassid
Java Control Panel (if installed)jpicpl32.cpl
Java Control Panel (if installed)javaws
Keyboard Propertiescontrol keyboard
Local Security Settingssecpol.msc
Local Users and Groupslusrmgr.msc
Logs You Out Of Windows logoff
Malicious Software Removal Tool mrt
Microsoft Access (if installed)msaccess
Microsoft Chatwinchat
Microsoft Excel (if installed)excel
Microsoft Frontpage (if installed)frontpg
Microsoft Movie Makermoviemk
Microsoft Paintmspaint
Microsoft Powerpoint (if installed)powerpnt
Microsoft Word (if installed)winword
Microsoft Syncronization Toolmobsync
Minesweeper Gamewinmine
Mouse Propertiescontrol mouse
Mouse Propertiesmain.cpl
Nero (if installed)nero
Netmeeting conf
Network Connectionscontrol netconnections
Network Connectionsncpa.cpl
Network Setup Wizardnetsetup.cpl
Notepadnotepad
Nview Desktop Manager (if installed)nvtuicpl.cpl
Object Packagerpackager
ODBC Data Source Administratorodbccp32.cpl
On Screen Keyboardosk
Opens AC3 Filter (if installed)ac3filter.cpl
Outlook Expressmsimn
Paintpbrush
Password Propertiespassword.cpl
Performance Monitorperfmon.msc
Performance Monitorperfmon
Phone and Modem Options telephon.cpl
Phone Dialerdialer
Pinball Gamepinball
Power Configuration powercfg.cpl
Printers and Faxescontrol printers
Printers Folderprinters
Private Character Editoreudcedit
Quicktime (If Installed)QuickTime.cpl
Quicktime Player (if installed)quicktimeplayer
Real Player (if installed)realplay
Regional Settings intl.cpl
Registry Editorregedit
Registry Editorregedit32
Remote Access Phonebookrasphone
Remote Desktop mstsc
Removable Storagentmsmgr.msc
Removable Storage Operator Requestsntmsoprq.msc
Resultant Set of Policy (XP Prof)
rsop.msc
Scanners and Camerassticpl.cpl
Scheduled Taskscontrol schedtasks
Security Center wscui.cpl
Servicesservices.msc
Shared Foldersfsmgmt.msc
Shuts Down Windowsshutdown
Sounds and Audio mmsys.cpl
Spider Solitare Card Gamespider
SQL Client Configuration cliconfg
System Configuration Editorsysedit
System Configuration Utilitymsconfig
System File Checker Utility (Scan Immediately)sfc /scannow
System File Checker Utility (Scan Once At The Next Boot)sfc /scanonce
System File Checker Utility (Scan On Every Boot)sfc /scanboot
System File Checker Utility (Return Scan Setting To Default)sfc /revert
System File Checker Utility (Purge File Cache)sfc /purgecache
System File Checker Utility (Sets Cache Size to size x)sfc /cachesize=x
System Informationmsinfo32
System Properties sysdm.cpl
Task Managertaskmgr
TCP Testertcptest
Telnet Clienttelnet
Tweak UI (if installed)tweakui
User Account Managementnusrmgr.cpl
Utility Managerutilman
Windows Address Bookwab
Windows Address Book Import Utilitywabmig
Windows Backup Utility (if installed)ntbackup
Windows Explorerexplorer
Windows Firewallfirewall.cpl
Windows Magnifier magnify
Windows Management Infrastructurewmimgmt.msc
Windows Media Playerwmplayer
Windows Messengermsmsgs
Windows Picture Import Wizard (need camera connected)wiaacmgr
Windows System Security Toolsyskey
Windows Update Launcheswupdmgr
Windows Version (to show which version of windows)winver
Windows XP Tour Wizardtourstart
Wordpad write

Thursday, September 8, 2011

Monday, September 5, 2011

Sunday, September 4, 2011

Auto-Implemented Properties in C# 3.0

This is one of the productive changes in C# 3.0 which makes your code more readable without writing more lines for implementing properties. In C# 2.0, we implement properties with get and set accessors for returning (get) a private member’s value and for setting (set) a private members value, like as follows:
 
   class Customer
   {
        private string customerID;
        public string CustomerID
        {
            get { return customerID; }
            set { customerID = value; }
        }
 
        private string contactName;
        public string ContactName
        {
            get { return contactName; }
            set { contactName = value; }
        }
 
        private string city;
        public string City
        {
            get { return city; }
            set { city = value; }
        }
   }
 
So, in the above code you have declared three properties, every time doing the same thing i.e. returning and setting a private members value, which reduces the readability of the code.
 
But in C# 3.0 the same pattern can be implemented in a better way like follows:
 
   class Customer
   {
        public string CustomerID { get; set; }
        public string ContactName { get; set; }
        public string City { get; set; }
   }
 
For the above given code C# Compiler will automatically generate backing fields.
 
But there is a limitation i.e. when we use this kind of syntax for implementing properties we have to implement both get and set accessors.
 
Whereas we can use modifiers today also with Auto implemented properties i.e. you can have properties as follows:
 
   public string CustomerID { get; private set; }

Anonymous Types in C# 3.0

C# 2.0 gave us Anonymous methods which are declared inline and had no formal name, in the same way C# 3.0 gives Anonymous Types which are created with the help of combining ‘var’ (Local Variable Type Inference) and Object Initializers as follows:
 
      var cust = new { CustID = 101, CustName = "Manish" };
 
For the above given code, C# compiler automatically generates a name. Each member of the type i.e. CustID and CustName are the properties taken from the syntax of Object Initializer.
 

Collection Initializers in C# 3.0

With C# 3.0, Collection Initializer is the combination of Collection Classes and Object Initializers. This feature is available for all the objects which are enumerable (i.e. they implement IEnumerable<T>) and have a public ‘Add’ Method to add the value.
   class CEmployee
   {
        private int EmpID;
        public int EID
        {
            get { return EmpID; }
            set { EmpID = value; }
        }
        private string EmpName;
        public string ENAME
        {
            get { return EmpName; }
            set { EmpName = value; }
        }
   }
Using the above given class, if you want to create a List of Employees, then in C# 2.0 the code will be:
   List<CEmployee> Employees = new List<CEmployee>();
   CEmployee e1 = new CEmployee(101, "Rohit Sharma");
// If you have  implemented Constructor
   Employees.Add(e1);
And, if there is no Constructor, then:
   List<CEmployee> Employees = new List<CEmployee>();
   CEmployee e1 = new CEmployee();
   e1.EID = 1;
   e1.ENAME = "Ramesh Sachin";
   Employees.Add(e1);
This is for 1 Employee, now if you want to add 5 Employees, then you have to create them separately and add them in the list one by one.
But in C# 3.0, it is made easier, like below:
   List<CEmployee> Employees = new List<CEmployee>()
   {
        new CEmployee() { EID = 101, ENAME = "Goutham" },
        new CEmployee() { EID = 102, ENAME = "Virat" },
        new CEmployee() { EID = 103, ENAME = "Raina" },
        new CEmployee() { EID = 104, ENAME = "Isanth" },
        new CEmployee() { EID = 105, ENAME = "Mahendar" }
   };

Object Initializers in C# 3.0

Object Initializers
This change in C# 3.0 allows developers to get rid of the constructors they have to write in case of C# 2.0. Say for example in C# 2.0 if you have a class named CEmployee as follows:
   class CEmployee
   {
        private int EmpID;
        public int EID
        {
            get { return EmpID; }
            set { EmpID = value; }
        }
        private string EmpName;
        public string ENAME
        {
            get { return EmpName; }
            set { EmpName = value; }
        }
   }
Now, if you want to initialize the objects at the time of declaration, as follows:
   CEmployee obj1 = new CEmployee(101, "Rohit Sharma");
   CEmployee obj2 = new CEmployee(102);
   CEmployee obj3 = new CEmployee("Rahul");
To write the code shown in the lines above, the developer should write three parameterized constructors inside the CEmployee class as follows:
   public CEmployee(int id, string name)
   {
        EmpID = id;
        EmpName = name;
   }
   public CEmployee(int id)
   {
        EmpID = id;
   }
   public CEmployee(string name)
   {
        EmpName = name;
   }
However in C# 3.0, if you have created properties inside your class as in above given CEmployee class, you do not have to write the constructors anymore. So C# 3.0 gives you this enhancement to write it easily as follows:
   CEmployee obj1 = new CEmployee() { EID = 102, ENAME = "Rahul" };
   CEmployee obj2 = new CEmployee() { EID = 103 };
   CEmployee obj3 = new CEmployee() { ENAME = "Vijay Kumar" };
The above given lines of code are easier to read in respect with C# 2.0 code, but you have to write a bit more code.

New Features of C# 3.0

The changes made in C# 3.0 are as follows:
  1. Local Variable Type Inference or Implicitly Typed Local Variables.
  2. Object Initializers 
  3.       Collection Initializers
  4.       Anonymous types
  5.       Auto-implemented properties
  6. Extension methods
  7. Lambda expressions
  8.        Query expressions
  9. Expression trees
  10.         Partial Methods
 Local Variable Type Inference
    var data = 1;
   data = 23.4f;                //Compile time Error
Interestingly ‘var’ can be used in any of the following ways:
Directly associating a value or type:
   var data1 = 10;             // data1 is of type System.Int32
   var data2 = 20.5f;          // data2 is of type System.Single
   var data3 = "Hello";        // data3 is of type System.String
   var data4 = new List<int>(); // data4 is of type Generic List<T>
   var data5 = new CEmployee(); // data5 is an instance of Class CEmployee
Associating with expressions:
     var data6 = 23 + 45;         // data6 is of type System.Int32
Association with methods:
In C# 2.0, if you want to call a method ( GetData( ) ) which returns you an integer, you will write something like this: 
     int data = GetData();
and if GetData() returns you a string, the above written line will throw an error, but now with ‘var’ you can write the same code as follows:
     var data = GetData();
Now even if your GetData() method returns you any type, the above written line need not be changed.
There are some rules associated with ‘var’, which are as follows:
1.    You must initialize ‘var’ type variables with some value or expression.
2.    Once the type is assigned to ‘var’ type variable you cannot change the type of value the variable holds.
3.    ‘var’ cannot be used as a return type of the methods.
var Add(int x,int y);              //Error
4.    ‘var’ cannot be used in argument list of the methods.
int Add(var x,var y);              //Error
5.    The contextual keyword 'var' can only appear within a local variable declaration         i.e. ‘var’ types can be created only inside a method or a block.

Saturday, September 3, 2011