Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging ASP.NET application at run-time
Message
 
 
To
17/01/2009 10:54:08
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01374333
Message ID:
01374666
Views:
12
>>First, thank you for your help. I thought I did try the following line in my code:
>
>>EventLog.CreateEventSource(source, logName);
>

>You're welcome. But I left out the most important part, silly me (and obviously nobody tried it, otherwise I would have heard about it! <g>).
>
>The CreateEventSource still needs to be run, which you tried yourself, but it needs to be done under some sort of valid authentication. The part that does that, in the code I posted, was left out. Sorry! I call a LogonUser() method, but I forgot to include that. Here it is:
>
>
>// Using this api to get an accessToken of specific Windows User by its user name and password	
>[DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
>static public extern bool LogonUser(string userName, string domain, string passWord, int logonType, int logonProvider, ref IntPtr accessToken);
>
>
>Now it should work. As I said, this only needs to be run once.
>
>~~Bonnie
>

Thank you for the additional information.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform