Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
QuestionLaunch txt file in deafult text editor Pin
Dwayner7915-Oct-07 12:50
Dwayner7915-Oct-07 12:50 
AnswerRe: Launch txt file in deafult text editor Pin
Christian Graus15-Oct-07 12:56
protectorChristian Graus15-Oct-07 12:56 
AnswerRe: Launch txt file in deafult text editor Pin
Luc Pattyn15-Oct-07 12:57
sitebuilderLuc Pattyn15-Oct-07 12:57 
GeneralRe: Launch txt file in deafult text editor Pin
Dwayner7915-Oct-07 13:13
Dwayner7915-Oct-07 13:13 
QuestionWorking with Active Directory Pin
Gene Arnold15-Oct-07 11:59
Gene Arnold15-Oct-07 11:59 
AnswerRe: Working with Active Directory Pin
Justin Perez15-Oct-07 12:17
Justin Perez15-Oct-07 12:17 
GeneralRe: Working with Active Directory Pin
Gene Arnold15-Oct-07 12:34
Gene Arnold15-Oct-07 12:34 
GeneralRe: Working with Active Directory Pin
Justin Perez15-Oct-07 12:53
Justin Perez15-Oct-07 12:53 
I am having a hard time finding the articles. I'm still looking, but here is a couple simple code snippets. Maybe they will give you somewhere to get started.

This code will get a Full name for a user from ADS.
public static string getFullName(string sUserAndDomain)
{
  string u = sUserAndDomain.Replace('\\', '/');

  try
  {
    DirectoryEntry e = new DirectoryEntry("WinNT://" + u);
    return (string)e.Properties["FullName"].Value;
  }
  catch (Exception)
  {
    return null;
  }
}


But to get that you need the User & Domain name of the logged in user. Below is the code

public static string getCurrentUsernameAndDomain()
{
  WindowsIdentity user = WindowsIdentity.GetCurrent();
  return user.Name;
}


I normally don't like giving out code like that, and I'm sure some people frown upon it. But, it's pretty simple and maybe that will get you headed in the right direction. If I can find those articles I'll post here. Hope that gets you started!

I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

QuestionHow to disable minimization. Pin
Y@rpen15-Oct-07 11:20
Y@rpen15-Oct-07 11:20 
AnswerRe: How to disable minimization. Pin
Anthony Mushrow15-Oct-07 11:38
professionalAnthony Mushrow15-Oct-07 11:38 
GeneralRe: How to disable minimization. Pin
Y@rpen15-Oct-07 11:45
Y@rpen15-Oct-07 11:45 
AnswerRe: How to disable minimization. Pin
Anthony Mushrow15-Oct-07 11:51
professionalAnthony Mushrow15-Oct-07 11:51 
GeneralRe: How to disable minimization. [modified] Pin
Y@rpen16-Oct-07 5:01
Y@rpen16-Oct-07 5:01 
GeneralRe: How to disable minimization. Pin
sushicw16-Oct-07 7:32
sushicw16-Oct-07 7:32 
GeneralRe: How to disable minimization. Pin
sushicw13-Nov-07 6:24
sushicw13-Nov-07 6:24 
Questionhow can get a file path when user double click on it such as word files? Pin
B.A15-Oct-07 10:01
B.A15-Oct-07 10:01 
AnswerRe: how can get a file path when user double click on it such as word files? Pin
pmarfleet15-Oct-07 10:48
pmarfleet15-Oct-07 10:48 
GeneralRe: how can get a file path when user double click on it such as word files? Pin
B.A15-Oct-07 11:04
B.A15-Oct-07 11:04 
QuestionCreating items for CheckedListBox Pin
s3rro15-Oct-07 9:45
s3rro15-Oct-07 9:45 
AnswerRe: Creating items for CheckedListBox Pin
Justin Perez15-Oct-07 10:08
Justin Perez15-Oct-07 10:08 
QuestionProject Resource Pin
mihksoft15-Oct-07 8:00
mihksoft15-Oct-07 8:00 
AnswerRe: Project Resource Pin
Justin Perez15-Oct-07 8:26
Justin Perez15-Oct-07 8:26 
GeneralRe: Project Resource Pin
mihksoft15-Oct-07 8:31
mihksoft15-Oct-07 8:31 
GeneralRe: Project Resource [modified] Pin
Kristian Sixhøj15-Oct-07 9:19
Kristian Sixhøj15-Oct-07 9:19 
QuestionConfiguration settings - Howto? [modified] Pin
Phrone15-Oct-07 7:01
Phrone15-Oct-07 7:01 

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.