Thursday, August 26, 2004

Backup and Restore WindowsXP Activation Files 

Have you ever wanted to reformat the hard disk and reinstall Windows XP
on a system but you didn't want to mess around with Microsoft's Product
Activation after the reinstall? Fortunately, you don't have to.

As long as you aren't making any hardware alterations, you can back up
the activation status files before you reformat the hard drive and then
restore them after you reinstall the operating system.

To perform the backup, follow these steps:

1. Use Windows Explorer to open the C:\Windows\System32 folder.
2. Copy the Wpa.dbl and Wpa.bak files to a floppy disk or CD.

To perform the restore, follow these steps:

1. Decline the activation request at the end of the installation
procedure, and restart Windows XP.
2. During bootup, press [F8] to access the Windows Advanced Options
menu.
3. Choose the Safe Mode (SAFEBOOT_OPTION=Minimal) option.
4. Use Windows Explorer to open the C:\Windows\System32 folder.
5. If they exist, rename the new Wpa.dbl and Wpa.bak files to
Wpadbl.new and Wpabak.new.
6. Copy the original Wpa.dbl and Wpa.bak files from the floppy disk or
CD to the C:\Windows\System32 folder.
7. Restart the system.

I found this tip at Tech Republic

Thursday, August 05, 2004

ASP.NET FormsAuthenticationTicket and Persistence 

In order to persist an authentication ticket across browser sessions when using FormsAuthentication, you must set the Expires value in the authentication cookie to the Expiration value from the authentication ticket. Otherwise, the cookie will expire as soon as the browser is closed.

Here is the relevant line of code:

authenticationCookie.Expires = ticket.Expiration;

For more explanation see: FormsAuthenticationTicket and Persistence


Comparing Type Information in C# 

I am not sure this is the best way to do this, but it works for now.

Boolean result = MyObject.GetType().Equals(typeof(System.Web.UI.HtmlControls.HtmlForm))

Basically you use the GetType method of an object and compare it to the another class using the typeof function which does not require an instatiated object, but simple the name of the class in question.

This page is powered by Blogger. Isn't yours?