Click here to Skip to main content
15,889,909 members
Home / Discussions / C#
   

C#

 
AnswerRe: get and update control values from another thread Pin
Shameel26-Feb-12 23:33
professionalShameel26-Feb-12 23:33 
QuestionHelp with impersonation please Pin
CCodeNewbie26-Feb-12 5:42
CCodeNewbie26-Feb-12 5:42 
QuestionRe: Help with impersonation please Pin
Richard MacCutchan26-Feb-12 6:05
mveRichard MacCutchan26-Feb-12 6:05 
AnswerRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 6:46
CCodeNewbie26-Feb-12 6:46 
GeneralRe: Help with impersonation please Pin
Richard MacCutchan26-Feb-12 6:54
mveRichard MacCutchan26-Feb-12 6:54 
GeneralRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 7:41
CCodeNewbie26-Feb-12 7:41 
AnswerRe: Help with impersonation please Pin
Luc Pattyn26-Feb-12 7:39
sitebuilderLuc Pattyn26-Feb-12 7:39 
GeneralRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 10:10
CCodeNewbie26-Feb-12 10:10 
Hi Luc,

As mentioned in my post to Richard (believing that the errors were indeed of a run-time nature) I put the code back into the service which generated a more accurate description of what the cause of the error is - I think the error in the formatting of the UPN that is being passes to wi - the error is

UserInfo write failed for host 2. Reason System.Security.SecurityException: Incorrect function.

at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName)
at Smith.Smith.OnTimedEvent(Object source, ElapsedEventArgs e)
The Zone of the assembly that failed was:
MyComputer

from the line "WindowsIdentity wi = new WindowsIdentity(logonuser)"

C#
string LOU = (queryObj["UserName"].ToString());
string[] LOUser = LOU.Split('\\');
string logonuser = (LOUser[1]+"@"+LOUser[0]);//have also tried (LOUser[1].Trim()) - (LOUser[1].Replace(" ","").Trim())- (LOUser[1].Trim().Replace(" ","")+"@"+LOUser[0])
WindowsIdentity wi = new WindowsIdentity(logonuser)

following the suggestions at http://forums.asp.net/p/1095241/1654338.aspx[^] and http://msdn.microsoft.com/en-us/library/windows/desktop/aa380525(v=vs.85).aspx[^]

From the error I gather that it is a constructor error but as the constructor is legal (or at least compiles in the service if not in the Console APP.) I am stuck.

I am sorry if my ignorance disappoints you, quote "Unsure | :~ " unquote.

Yes, I am learning but as stated above, when the compiler/execution throws me a curve-ball I do struggle sometimes, especially when after multiple hours of research, trial-and-error and throwing code at the problem leaves me back where I started.

I do not develop code as a profession, I try and grab a few hours a week where time allows to try and develop an app that would help me and others in the job that I do.

Out of curiosity, which of my previous posts refers to the issues I am encountering above?
AnswerRe: Help with impersonation please Pin
Luc Pattyn26-Feb-12 6:14
sitebuilderLuc Pattyn26-Feb-12 6:14 
GeneralRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 6:53
CCodeNewbie26-Feb-12 6:53 
QuestionConverting audio file into a binary display Pin
kfir.alf26-Feb-12 3:20
kfir.alf26-Feb-12 3:20 
AnswerRe: Converting audio file into a binary display Pin
OriginalGriff26-Feb-12 4:12
mveOriginalGriff26-Feb-12 4:12 
GeneralRe: Converting audio file into a binary display Pin
kfir.alf26-Feb-12 4:56
kfir.alf26-Feb-12 4:56 
GeneralRe: Converting audio file into a binary display Pin
Eddy Vluggen26-Feb-12 11:11
professionalEddy Vluggen26-Feb-12 11:11 
GeneralRe: Converting audio file into a binary display Pin
V.26-Feb-12 21:14
professionalV.26-Feb-12 21:14 
QuestionRed Five Labs + C# Pin
jojoba201125-Feb-12 22:46
jojoba201125-Feb-12 22:46 
AnswerRe: Red Five Labs + C# Pin
Dan Mos26-Feb-12 3:48
Dan Mos26-Feb-12 3:48 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 4:01
jojoba201126-Feb-12 4:01 
AnswerRe: Red Five Labs + C# Pin
OriginalGriff26-Feb-12 4:15
mveOriginalGriff26-Feb-12 4:15 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 4:23
jojoba201126-Feb-12 4:23 
AnswerRe: Red Five Labs + C# Pin
Dan Mos26-Feb-12 9:00
Dan Mos26-Feb-12 9:00 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 23:18
jojoba201126-Feb-12 23:18 
AnswerRe: Red Five Labs + C# Pin
Pete O'Hanlon27-Feb-12 0:08
mvePete O'Hanlon27-Feb-12 0:08 
Questioncant read joystick data Managed DX, SlimDX Pin
DerecL25-Feb-12 13:07
DerecL25-Feb-12 13:07 
QuestionHelp need regarding SendMessageTimeout for IE window Pin
vishal nerkar25-Feb-12 7:51
vishal nerkar25-Feb-12 7:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.