Impersonating administrator
Developing to sharepoint 2003, you often need to access data, that only an administrator has access to. To do that in code, you need to impersonate an administrator. The classic solution looks like this.
Add the following code to your project:
private WindowsImpersonationContext ctx = null;
public void UseAppPoolIdentity(){
try{
if (!WindowsIdentity.GetCurrent().IsSystem){
ctx = WindowsIdentity.Impersonate(System.IntPtr.Zero);
}
}
catch{}
}
public [...]