Click here to Skip to main content
15,888,208 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error 1 The modifier 'abstract' is not valid for this item Pin
RaoulICT17-Jul-12 19:26
RaoulICT17-Jul-12 19:26 
GeneralRe: Error 1 The modifier 'abstract' is not valid for this item Pin
Trak4Net17-Jul-12 19:31
Trak4Net17-Jul-12 19:31 
AnswerRe: Error 1 The modifier 'abstract' is not valid for this item Pin
BobJanova18-Jul-12 3:46
BobJanova18-Jul-12 3:46 
GeneralRe: Error 1 The modifier 'abstract' is not valid for this item Pin
PIEBALDconsult18-Jul-12 4:22
mvePIEBALDconsult18-Jul-12 4:22 
AnswerRe: Error 1 The modifier 'abstract' is not valid for this item Pin
Luc Pattyn18-Jul-12 6:49
sitebuilderLuc Pattyn18-Jul-12 6:49 
QuestionUser Authenticattion Pin
harrypsd17-Jul-12 10:01
harrypsd17-Jul-12 10:01 
AnswerRe: User Authenticattion Pin
Bernhard Hiller17-Jul-12 20:31
Bernhard Hiller17-Jul-12 20:31 
AnswerRe: User Authenticattion Pin
_Amy17-Jul-12 20:53
professional_Amy17-Jul-12 20:53 
Hi,
Try this to List all the users from current domain.
C#
// Here user can compare a list of user with current user
public static void getUser()
 {
     DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.UserDomainName);
     string userNames = "";
     string authenticationType="";
     foreach (DirectoryEntry child in directoryEntry.Children)
     {
         if (child.SchemaClassName == "User")
         {
             userNames += child.Name + Environment.NewLine; //Iterates and binds all user using a newline
             authenticationType += child.Username + Environment.NewLine;
         }
     }
     Console.WriteLine("************************Users************************");
     Console.WriteLine(userNames);
     Console.WriteLine("*****************Authentication Type*****************");
     //Console.WriteLine(authenticationType);
 }

And this for Getting a particular user details from user's active directory
C#
//remove if statement to get the information about all the user's
public static void fnImp() {
    using (var context = new PrincipalContext(ContextType.Domain, Environment.UserDomainName))
    {
        using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
        {
            foreach (var result in searcher.FindAll())
            {
                DirectoryEntry de = result.GetUnderlyingObject() as DirectoryEntry;
                if ((string)de.Properties["givenName"].Value == Environment.UserName)
                {
                    //Console.WriteLine("First Name: " + de.Properties["givenName"].Value);
                    //Console.WriteLine("Last Name : " + de.Properties["sn"].Value);
                    //Console.WriteLine("SAM account name   : " + de.Properties["samAccountName"].Value);
                    //Console.WriteLine("User principal name: " + de.Properties["userPrincipalName"].Value);
                    Console.WriteLine();
                    PropertyCollection pc = de.Properties;
                    foreach (PropertyValueCollection col in pc)
                    {
                        Console.WriteLine(col.PropertyName + " : " + col.Value);
                        Console.WriteLine();
                    }
                }
            }
        }
    }
    Console.ReadLine();
}

Read the article "Table Valued Parameters".

--Amit

AnswerRe: User Authenticattion Pin
Eddy Vluggen18-Jul-12 1:11
professionalEddy Vluggen18-Jul-12 1:11 
QuestionCreating Minidumps After Error Pin
Richard Andrew x6417-Jul-12 9:57
professionalRichard Andrew x6417-Jul-12 9:57 
AnswerRe: Creating Minidumps After Error Pin
Eddy Vluggen17-Jul-12 11:19
professionalEddy Vluggen17-Jul-12 11:19 
GeneralRe: Creating Minidumps After Error Pin
Richard Andrew x6417-Jul-12 12:29
professionalRichard Andrew x6417-Jul-12 12:29 
Questioninsert data from Oracle to MS SQL Pin
Ubun2OS17-Jul-12 5:57
Ubun2OS17-Jul-12 5:57 
AnswerRe: insert data from Oracle to MS SQL PinPopular
Pete O'Hanlon17-Jul-12 6:09
mvePete O'Hanlon17-Jul-12 6:09 
GeneralRe: insert data from Oracle to MS SQL Pin
PIEBALDconsult17-Jul-12 6:41
mvePIEBALDconsult17-Jul-12 6:41 
GeneralRe: insert data from Oracle to MS SQL Pin
Pete O'Hanlon17-Jul-12 8:07
mvePete O'Hanlon17-Jul-12 8:07 
GeneralRe: insert data from Oracle to MS SQL Pin
PIEBALDconsult17-Jul-12 9:27
mvePIEBALDconsult17-Jul-12 9:27 
QuestionCreating subobjects within an object? Pin
Goalie3517-Jul-12 5:43
Goalie3517-Jul-12 5:43 
AnswerRe: Creating subobjects within an object? Pin
Luc Pattyn17-Jul-12 6:40
sitebuilderLuc Pattyn17-Jul-12 6:40 
GeneralRe: Creating subobjects within an object? Pin
BobJanova18-Jul-12 4:38
BobJanova18-Jul-12 4:38 
AnswerRe: Creating subobjects within an object? Pin
Luc Pattyn18-Jul-12 5:22
sitebuilderLuc Pattyn18-Jul-12 5:22 
AnswerRe: Creating subobjects within an object? Pin
TheGreatAndPowerfulOz9-Aug-12 4:26
TheGreatAndPowerfulOz9-Aug-12 4:26 
QuestionCompare Images "before and after" Pin
ToBick16-Jul-12 22:03
ToBick16-Jul-12 22:03 
AnswerRe: Compare Images "before and after" Pin
Eddy Vluggen16-Jul-12 23:13
professionalEddy Vluggen16-Jul-12 23:13 
GeneralRe: Compare Images "before and after" Pin
ToBick17-Jul-12 4:47
ToBick17-Jul-12 4:47 

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.