Click here to Skip to main content
15,868,141 members
Home / Discussions / C#
   

C#

 
QuestionRe: Detect if ANY control is clicked inside a form Pin
Richard Deeming3-Dec-12 3:10
mveRichard Deeming3-Dec-12 3:10 
AnswerRe: Detect if ANY control is clicked inside a form Pin
Dennis Bork3-Dec-12 3:14
Dennis Bork3-Dec-12 3:14 
SuggestionRe: Detect if ANY control is clicked inside a form Pin
Richard Deeming3-Dec-12 3:25
mveRichard Deeming3-Dec-12 3:25 
AnswerRe: Detect if ANY control is clicked inside a form Pin
Simon_Whale3-Dec-12 3:45
Simon_Whale3-Dec-12 3:45 
GeneralRe: Detect if ANY control is clicked inside a form Pin
Thomas Daniels3-Dec-12 7:28
mentorThomas Daniels3-Dec-12 7:28 
AnswerRe: Detect if ANY control is clicked inside a form Pin
DaveyM693-Dec-12 5:02
professionalDaveyM693-Dec-12 5:02 
Question[SOLVED] Setting the focus back to the window which had it last Pin
Dennis Bork3-Dec-12 2:33
Dennis Bork3-Dec-12 2:33 
QuestionAD Directory catastrophic failure Pin
MacUseless2-Dec-12 21:56
MacUseless2-Dec-12 21:56 
Hi,

I'm having some issues with reading an AD directory,
Each time i request the directory from AD i get the following catastrophic failure
Later in the program i'm using a impersonation class.
When i disable this the code works otherwise it returns the catastrophic failure.

C#
//string OU = "OU=Medewerkers,OU=Hogeschool Utrecht,DC=medewerkers,DC=ad,DC=hvu,DC=nl"; // AD LDAP medewerkers
//dirEntry.AuthenticationType = AuthenticationTypes.Secure;
string OU = "DC=medewerkers,DC=ad,DC=hvu,DC=nl"; // AD LDAP medewerkers
DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + OU);
DirectorySearcher dirSearcher = new DirectorySearcher(dirEntry);
dirSearcher.SearchScope = SearchScope.Subtree;

dirSearcher.Filter = "mail=" + user;// er wordt hier gefilterd op email adres

dirSearcher.PropertiesToLoad.Add("profilePath");// Reads AD profile and returns the profilePath i.e. \\mdw\dfs\profiles\benjamin.diepeveen
SearchResult sResult = dirSearcher.FindOne();// Returns catastrophic failure



This is my impersonation, when i disable this my code works but only for local users.
C#
                using (new Impersonator(txtGebruiker.Text, txtDomein.Text, txtPw.Text))
                {
                    // this will attempt to change the directory to <directoryname>.old if you have proper acccess
                    string profile = GetProfilePath(txtProfiel.Text);
                    //Directory.Move(profile, profile + ".old");
                    Directory.Move(@"C:\Test", @"C:\Test.old");
                    txtLog.Text = "Profiel locatie\n" + profile + "is omgezet naar .old "; // displays the profile name in log
}


Any help / suggestions or hints on what i did wrong are
appriciated.

Thanks in advance Smile | :)
AnswerRe: AD Directory catastrophic failure Pin
Dave Kreskowiak3-Dec-12 2:20
mveDave Kreskowiak3-Dec-12 2:20 
AnswerRe: AD Directory catastrophic failure Pin
Jason Gleim3-Dec-12 10:05
professionalJason Gleim3-Dec-12 10:05 
GeneralRe: AD Directory catastrophic failure Pin
MacUseless3-Dec-12 20:34
MacUseless3-Dec-12 20:34 
QuestionTFS 2010 : Email alerts are not working Pin
NarVish2-Dec-12 21:04
NarVish2-Dec-12 21:04 
AnswerRe: TFS 2010 : Email alerts are not working Pin
Richard MacCutchan2-Dec-12 21:52
mveRichard MacCutchan2-Dec-12 21:52 
GeneralRe: TFS 2010 : Email alerts are not working Pin
NarVish2-Dec-12 21:59
NarVish2-Dec-12 21:59 
AnswerRe: TFS 2010 : Email alerts are not working Pin
Pete O'Hanlon2-Dec-12 21:53
subeditorPete O'Hanlon2-Dec-12 21:53 
QuestionThesis project Pin
khinn Lyndon Samson2-Dec-12 19:46
khinn Lyndon Samson2-Dec-12 19:46 
AnswerRe: Thesis project Pin
Pete O'Hanlon2-Dec-12 21:18
subeditorPete O'Hanlon2-Dec-12 21:18 
AnswerRe: Thesis project Pin
Abhinav S2-Dec-12 22:05
Abhinav S2-Dec-12 22:05 
QuestionUDF 64bit vs 32bit Excel 2010 Pin
PozzaVecia2-Dec-12 4:39
PozzaVecia2-Dec-12 4:39 
RantRe: UDF 64bit vs 32bit Excel 2010 Pin
Mycroft Holmes2-Dec-12 11:36
professionalMycroft Holmes2-Dec-12 11:36 
GeneralRe: UDF 64bit vs 32bit Excel 2010 Pin
Richard MacCutchan2-Dec-12 21:48
mveRichard MacCutchan2-Dec-12 21:48 
Questiondetermine listbox items origin Pin
User 94041061-Dec-12 11:40
User 94041061-Dec-12 11:40 
AnswerRe: determine listbox items origin Pin
Mycroft Holmes1-Dec-12 13:04
professionalMycroft Holmes1-Dec-12 13:04 
AnswerRe: determine listbox items origin Pin
Freak303-Dec-12 0:53
Freak303-Dec-12 0:53 
GeneralRe: determine listbox items origin Pin
User 94041063-Dec-12 9:35
User 94041063-Dec-12 9:35 

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.