Posted on November 28, 2006, 10:57 pm, by Claus, under
.NET,
ASP.NET.
I noticed many people are using the weeks, as a way of describing time. I have never used weeks, so I never know where to look up what date, a week is.
I have always thought that it would be easy to make a program in .NET that do the work for me, and it really [...]
Posted on November 20, 2006, 10:52 pm, by Claus, under
General.
Long time no see. It’s been a long time since my last post. That is partly due to my new job. I just changed workplace from one of the biggest software companies in Scandinavia, to a little software consulting company with 18 employees.
My short-sighted plan with this blog, was actually to write about my points [...]
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 [...]