Click here to Skip to main content
15,885,435 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Get rid of WaitCursor Pin
Luc Pattyn5-Sep-11 1:29
sitebuilderLuc Pattyn5-Sep-11 1:29 
GeneralRe: Get rid of WaitCursor Pin
MicroVirus5-Sep-11 11:17
MicroVirus5-Sep-11 11:17 
QuestionDeploying Reports Pin
eddieangel30-Aug-11 6:40
eddieangel30-Aug-11 6:40 
AnswerRe: Deploying Reports Pin
army_man7165530-Aug-11 8:00
army_man7165530-Aug-11 8:00 
Questionwindows forms using active directory Pin
dcof24-Aug-11 5:50
dcof24-Aug-11 5:50 
AnswerRe: windows forms using active directory Pin
GenJerDan24-Aug-11 6:16
GenJerDan24-Aug-11 6:16 
GeneralRe: windows forms using active directory Pin
dcof24-Aug-11 11:42
dcof24-Aug-11 11:42 
GeneralRe: windows forms using active directory Pin
GenJerDan25-Aug-11 3:22
GenJerDan25-Aug-11 3:22 
The only real difference is where you get the current user info from for your authentication.

In asp, I use this function (everyone stop laughing...I never got around to cleaning it up):

C#
public string Whoami()
    {
      string str;
      int idx;
      str = System.Web.HttpContext.Current.Request.LogonUserIdentity.Name;
      idx = str.IndexOf("\\");
      return str.Substring(idx + 1);
    }



But on the desktop, all you need is:

string SAMS = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Then diddle a little with it to get just the login:

string[] SAM = SAMS.Split(Delim, StringSplitOptions.RemoveEmptyEntries);
with SAM[1] being the login without the domain.

After that, you can check AD to see if the user is authorized, or whatever.
I thought you had to go to Pittsburgh for that.

My Mu[sic]
My Films
My Windows Programs, etc.

QuestionHost a WPF form/application windows inside a Winform - how? Pin
devvvy16-Aug-11 15:30
devvvy16-Aug-11 15:30 
AnswerRe: Host a WPF form/application windows inside a Winform - how? Pin
Simon Bang Terkildsen20-Aug-11 15:14
Simon Bang Terkildsen20-Aug-11 15:14 
QuestionWindows7 hosts file is ignored Pin
Muammar©13-Aug-11 20:45
Muammar©13-Aug-11 20:45 
AnswerRe: Windows7 hosts file is ignored Pin
Eddy Vluggen13-Aug-11 22:24
professionalEddy Vluggen13-Aug-11 22:24 
AnswerRe: Windows7 hosts file is ignored Pin
DaveAuld13-Aug-11 22:44
professionalDaveAuld13-Aug-11 22:44 
Questionwindows front end Pin
jon18889-Aug-11 14:59
jon18889-Aug-11 14:59 
AnswerRe: windows front end Pin
Shameel9-Aug-11 22:22
professionalShameel9-Aug-11 22:22 
GeneralRe: windows front end Pin
jon188810-Aug-11 5:10
jon188810-Aug-11 5:10 
AnswerRe: windows front end Pin
Abhinav S10-Aug-11 1:09
Abhinav S10-Aug-11 1:09 
GeneralRe: windows front end Pin
jon188810-Aug-11 5:12
jon188810-Aug-11 5:12 
AnswerRe: windows front end Pin
MicroVirus10-Aug-11 5:40
MicroVirus10-Aug-11 5:40 
GeneralRe: windows front end Pin
jon188810-Aug-11 6:01
jon188810-Aug-11 6:01 
GeneralRe: windows front end Pin
MicroVirus10-Aug-11 7:40
MicroVirus10-Aug-11 7:40 
AnswerRe: windows front end Pin
Eddy Vluggen10-Aug-11 12:07
professionalEddy Vluggen10-Aug-11 12:07 
GeneralRe: windows front end Pin
jon188810-Aug-11 12:47
jon188810-Aug-11 12:47 
GeneralRe: windows front end Pin
Eddy Vluggen10-Aug-11 13:04
professionalEddy Vluggen10-Aug-11 13:04 
GeneralRe: windows front end Pin
jon188810-Aug-11 16:07
jon188810-Aug-11 16:07 

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.