|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get LOGON USER name in .NET 2.0I recentlly converted some web services to 2.0. So far everything has worked
great with the exception of one of the functions in an AD service. the following code: string sUser = HttpContext.Current.Request.ServerVariables["LOGON_USER"]; Worksk fine if debugging in VS 2005 but when I publish to the server. An empty string is returned. I have tried to catch an error and does not appear to be one. string sUser = HttpContext.Current.User.Name
Show quote "Brad King" <BradK***@discussions.microsoft.com> wrote in message news:911E5550-9004-4E39-A54D-CF10FE22829C@microsoft.com... >I recentlly converted some web services to 2.0. So far everything has >worked > great with the exception of one of the functions in an AD service. > > the following code: > string sUser = HttpContext.Current.Request.ServerVariables["LOGON_USER"]; > > Worksk fine if debugging in VS 2005 but when I publish to the server. An > empty string is returned. I have tried to catch an error and does not > appear > to be one. > This does not work for me
'System.Security.Principal.IPrincipal' does not contain a definition for 'Name' Show quote "Norman Yuan" wrote: > string sUser = HttpContext.Current.User.Name > > "Brad King" <BradK***@discussions.microsoft.com> wrote in message > news:911E5550-9004-4E39-A54D-CF10FE22829C@microsoft.com... > >I recentlly converted some web services to 2.0. So far everything has > >worked > > great with the exception of one of the functions in an AD service. > > > > the following code: > > string sUser = HttpContext.Current.Request.ServerVariables["LOGON_USER"]; > > > > Worksk fine if debugging in VS 2005 but when I publish to the server. An > > empty string is returned. I have tried to catch an error and does not > > appear > > to be one. > > > > > What form of authentication are you using in your application? Forms?
Windows? What is the IIS application configured to use? Anonymous? Integrated? Show quote "Brad King" wrote: > > This does not work for me > > 'System.Security.Principal.IPrincipal' does not contain a definition for > 'Name' > > > "Norman Yuan" wrote: > > > string sUser = HttpContext.Current.User.Name > > > > "Brad King" <BradK***@discussions.microsoft.com> wrote in message > > news:911E5550-9004-4E39-A54D-CF10FE22829C@microsoft.com... > > >I recentlly converted some web services to 2.0. So far everything has > > >worked > > > great with the exception of one of the functions in an AD service. > > > > > > the following code: > > > string sUser = HttpContext.Current.Request.ServerVariables["LOGON_USER"]; > > > > > > Worksk fine if debugging in VS 2005 but when I publish to the server. An > > > empty string is returned. I have tried to catch an error and does not > > > appear > > > to be one. > > > > > > > > > |
|||||||||||||||||||||||