Monday, February 23, 2009

Reboot form command line

shutdown -r

Mark a COM object as safe for scripting..

The following illustration shows a snapshot of the registry entry for the TDC, an ActiveX control that ships with Internet Explorer and allows authors to create data-driven Web pages. Because the control is safe for scripting and initialization, it marks itself in the registry as safe for scripting (7DD95801-9882-11CF-9FA9-00AA006C42C4) and safe for initializing from persistent data (7DD95802-9882-11CF-9FA9-00AA006C42C4).

Registry entry for a control

Tuesday, February 17, 2009

Enable asp.net 2.0 in webservice extensions IIS6

Copied from:

http://office.microsoft.com/en-us/winsharepointadmin/HA100598511033.aspx

  1. Click Start, and then click Run.
  2. In the Open box, type cmd and then click OK.
  3. Open the following directory:%drive%\WINNT\Microsoft.NET\Framework\v2.0.nnnnn

    where %drive% is the drive letter on which you installed Windows Server 2003 and nnnnn is the least significant version number of ASP.NET 2.0.

     Note   If you are running a 64-bit edition of Windows Server 2003 do not open the 64-bit directory. Windows SharePoint Services requires that IIS be run in 32-bit mode.
    Klaus' Note:
    Personally I had better success using the 64.bit directory.

  4. Run the following command at the command prompt: aspnet_regiis.exe -iru -enable
  5. Close the command prompt.
  6. In Internet Information Services (IIS) Manager click Refresh from the Action menu.
  7. Verify that ASP.NET v2.0.nnnnn is listed in the Web Service Extension column and that the status is Allowed. If the status isProhibited, you can change the status by right-clicking ASP.NET v2.0.nnnnn and then clicking Allow.
  8. After verifying that ASP.NET is allowed, the next step is to specify which virtual server or virtual servers you want to use ASP.NET 2.0. Proceed to Specifying which virtual servers use ASP.NET 2.0.

Left pad using string.Format()

Maybe you already know this  but it took me many years to discover. 
You can left pad by adding   ,-X to the place holder in the format string.

Eg. the following lines:
Console.WriteLine(string.Format("  IsOK={0,-5} Name: {1,-20} xxx", true, "Klaus"));
Console.WriteLine(string.Format("  IsOK={0,-5} Name: {1,-20} xxx", false, "James"));
Console.WriteLine(string.Format("  IsOK={0,-5} Name: {1,-20} xxx", true, "RAU"));

produce the following output:




Nice isn’t it!