PC Review


Reply
Thread Tools Rate Thread

Anyone have sample code to show the current windows username?

 
 
=?Utf-8?B?RGF2aWQgQmllbnN0b2Nr?=
Guest
Posts: n/a
 
      5th May 2005
Does anyone have sample code to show the current windows username? I didn't
want to run this on the server. Javascript is OK, but I need it in HTML page
and .HTM file, so it can't be server-side or ASP.

I just want a page that has a title and "You're logged in as: XXXX\YYYY".

Any ideas?
--
"Everyone knows something you don't know"
 
Reply With Quote
 
 
 
 
clintonG
Guest
Posts: n/a
 
      5th May 2005
Ain't gonna happen unless its done on the server and the user has logged in
where the name can be retrieved from a database or XML file.


<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


"David Bienstock" <(E-Mail Removed)> wrote in
message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
> Does anyone have sample code to show the current windows username? I
> didn't
> want to run this on the server. Javascript is OK, but I need it in HTML
> page
> and .HTM file, so it can't be server-side or ASP.
>
> I just want a page that has a title and "You're logged in as: XXXX\YYYY".
>
> Any ideas?
> --
> "Everyone knows something you don't know"



 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQmllbnN0b2Nr?=
Guest
Posts: n/a
 
      5th May 2005
I got it to work with a default record having "suser_sname()" in a field that
I could use
--
"Everyone knows something you don't know"


"clintonG" wrote:

> Ain't gonna happen unless its done on the server and the user has logged in
> where the name can be retrieved from a database or XML file.
>
>
> <%= Clinton Gallagher
> METROmilwaukee (sm) "A Regional Information Service"
> NET csgallagher AT metromilwaukee.com
> URL http://metromilwaukee.com/
> URL http://clintongallagher.metromilwaukee.com/
>
>
> "David Bienstock" <(E-Mail Removed)> wrote in
> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
> > Does anyone have sample code to show the current windows username? I
> > didn't
> > want to run this on the server. Javascript is OK, but I need it in HTML
> > page
> > and .HTM file, so it can't be server-side or ASP.
> >
> > I just want a page that has a title and "You're logged in as: XXXX\YYYY".
> >
> > Any ideas?
> > --
> > "Everyone knows something you don't know"

>
>
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      6th May 2005
>I got it to work with a default record having "suser_sname()" in a field
>that
> I could use
> --

Okay, smart guy. Now, go to your neighbor's house, log onto your web site
anonymously and see what the user name is. Unless you require a Windows
login, your users all log in to your Internet web site under the anonymous
Internet User account.

> "Everyone knows something you don't know"


A 2-year-old knows nothing that I don't know. Learn from the experience of
those who have gone before you before you try to go beyond them. And when
you do try to go beyond, be careful that you don't slip. There are no
guardrails there.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David Bienstock" <(E-Mail Removed)> wrote in
message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>I got it to work with a default record having "suser_sname()" in a field
>that
> I could use
> --
> "Everyone knows something you don't know"
>
>
> "clintonG" wrote:
>
>> Ain't gonna happen unless its done on the server and the user has logged
>> in
>> where the name can be retrieved from a database or XML file.
>>
>>
>> <%= Clinton Gallagher
>> METROmilwaukee (sm) "A Regional Information Service"
>> NET csgallagher AT metromilwaukee.com
>> URL http://metromilwaukee.com/
>> URL http://clintongallagher.metromilwaukee.com/
>>
>>
>> "David Bienstock" <(E-Mail Removed)> wrote in
>> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>> > Does anyone have sample code to show the current windows username? I
>> > didn't
>> > want to run this on the server. Javascript is OK, but I need it in
>> > HTML
>> > page
>> > and .HTM file, so it can't be server-side or ASP.
>> >
>> > I just want a page that has a title and "You're logged in as:
>> > XXXX\YYYY".
>> >
>> > Any ideas?
>> > --
>> > "Everyone knows something you don't know"

>>
>>
>>



 
Reply With Quote
 
clintonG
Guest
Posts: n/a
 
      6th May 2005
I think I'm going to be nice to you from now on ;-)

<%= Clinton Gallagher


"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >I got it to work with a default record having "suser_sname()" in a field
> >that
>> I could use
>> --

> Okay, smart guy. Now, go to your neighbor's house, log onto your web site
> anonymously and see what the user name is. Unless you require a Windows
> login, your users all log in to your Internet web site under the anonymous
> Internet User account.
>
>> "Everyone knows something you don't know"

>
> A 2-year-old knows nothing that I don't know. Learn from the experience of
> those who have gone before you before you try to go beyond them. And when
> you do try to go beyond, be careful that you don't slip. There are no
> guardrails there.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
> "David Bienstock" <(E-Mail Removed)> wrote in
> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>>I got it to work with a default record having "suser_sname()" in a field
>>that
>> I could use
>> --
>> "Everyone knows something you don't know"
>>
>>
>> "clintonG" wrote:
>>
>>> Ain't gonna happen unless its done on the server and the user has logged
>>> in
>>> where the name can be retrieved from a database or XML file.
>>>
>>>
>>> <%= Clinton Gallagher
>>> METROmilwaukee (sm) "A Regional Information Service"
>>> NET csgallagher AT metromilwaukee.com
>>> URL http://metromilwaukee.com/
>>> URL http://clintongallagher.metromilwaukee.com/
>>>
>>>
>>> "David Bienstock" <(E-Mail Removed)> wrote in
>>> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>>> > Does anyone have sample code to show the current windows username? I
>>> > didn't
>>> > want to run this on the server. Javascript is OK, but I need it in
>>> > HTML
>>> > page
>>> > and .HTM file, so it can't be server-side or ASP.
>>> >
>>> > I just want a page that has a title and "You're logged in as:
>>> > XXXX\YYYY".
>>> >
>>> > Any ideas?
>>> > --
>>> > "Everyone knows something you don't know"
>>>
>>>
>>>

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      6th May 2005
I need all the friends I can get! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"clintonG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think I'm going to be nice to you from now on ;-)
>
> <%= Clinton Gallagher
>
>
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> >I got it to work with a default record having "suser_sname()" in a field
>> >that
>>> I could use
>>> --

>> Okay, smart guy. Now, go to your neighbor's house, log onto your web site
>> anonymously and see what the user name is. Unless you require a Windows
>> login, your users all log in to your Internet web site under the
>> anonymous Internet User account.
>>
>>> "Everyone knows something you don't know"

>>
>> A 2-year-old knows nothing that I don't know. Learn from the experience
>> of those who have gone before you before you try to go beyond them. And
>> when you do try to go beyond, be careful that you don't slip. There are
>> no guardrails there.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "David Bienstock" <(E-Mail Removed)> wrote in
>> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>>>I got it to work with a default record having "suser_sname()" in a field
>>>that
>>> I could use
>>> --
>>> "Everyone knows something you don't know"
>>>
>>>
>>> "clintonG" wrote:
>>>
>>>> Ain't gonna happen unless its done on the server and the user has
>>>> logged in
>>>> where the name can be retrieved from a database or XML file.
>>>>
>>>>
>>>> <%= Clinton Gallagher
>>>> METROmilwaukee (sm) "A Regional Information Service"
>>>> NET csgallagher AT metromilwaukee.com
>>>> URL http://metromilwaukee.com/
>>>> URL http://clintongallagher.metromilwaukee.com/
>>>>
>>>>
>>>> "David Bienstock" <(E-Mail Removed)> wrote in
>>>> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>>>> > Does anyone have sample code to show the current windows username? I
>>>> > didn't
>>>> > want to run this on the server. Javascript is OK, but I need it in
>>>> > HTML
>>>> > page
>>>> > and .HTM file, so it can't be server-side or ASP.
>>>> >
>>>> > I just want a page that has a title and "You're logged in as:
>>>> > XXXX\YYYY".
>>>> >
>>>> > Any ideas?
>>>> > --
>>>> > "Everyone knows something you don't know"
>>>>
>>>>
>>>>

>>
>>

>
>



 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQmllbnN0b2Nr?=
Guest
Posts: n/a
 
      6th May 2005
1st of all a 2 year old knows how to behave, unlike you... mostly kidding.

Actually because I have OWC hooked into the website it does pull in the
username.
--
"Everyone knows something you don't know"


"Kevin Spencer" wrote:

> >I got it to work with a default record having "suser_sname()" in a field
> >that
> > I could use
> > --

> Okay, smart guy. Now, go to your neighbor's house, log onto your web site
> anonymously and see what the user name is. Unless you require a Windows
> login, your users all log in to your Internet web site under the anonymous
> Internet User account.
>
> > "Everyone knows something you don't know"

>
> A 2-year-old knows nothing that I don't know. Learn from the experience of
> those who have gone before you before you try to go beyond them. And when
> you do try to go beyond, be careful that you don't slip. There are no
> guardrails there.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> What You Seek Is What You Get.
>
> "David Bienstock" <(E-Mail Removed)> wrote in
> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
> >I got it to work with a default record having "suser_sname()" in a field
> >that
> > I could use
> > --
> > "Everyone knows something you don't know"
> >
> >
> > "clintonG" wrote:
> >
> >> Ain't gonna happen unless its done on the server and the user has logged
> >> in
> >> where the name can be retrieved from a database or XML file.
> >>
> >>
> >> <%= Clinton Gallagher
> >> METROmilwaukee (sm) "A Regional Information Service"
> >> NET csgallagher AT metromilwaukee.com
> >> URL http://metromilwaukee.com/
> >> URL http://clintongallagher.metromilwaukee.com/
> >>
> >>
> >> "David Bienstock" <(E-Mail Removed)> wrote in
> >> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
> >> > Does anyone have sample code to show the current windows username? I
> >> > didn't
> >> > want to run this on the server. Javascript is OK, but I need it in
> >> > HTML
> >> > page
> >> > and .HTM file, so it can't be server-side or ASP.
> >> >
> >> > I just want a page that has a title and "You're logged in as:
> >> > XXXX\YYYY".
> >> >
> >> > Any ideas?
> >> > --
> >> > "Everyone knows something you don't know"
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      6th May 2005
> Actually because I have OWC hooked into the website it does pull in the
> username.


....which will be anonymous unless you require a Windows login to access your
site, or are viewing the site located on your own computer, while logged
into your own computer.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David Bienstock" <(E-Mail Removed)> wrote in
message news:A889EEE6-7F1E-4686-AFC4-(E-Mail Removed)...
> 1st of all a 2 year old knows how to behave, unlike you... mostly kidding.
>
> Actually because I have OWC hooked into the website it does pull in the
> username.
> --
> "Everyone knows something you don't know"
>
>
> "Kevin Spencer" wrote:
>
>> >I got it to work with a default record having "suser_sname()" in a field
>> >that
>> > I could use
>> > --

>> Okay, smart guy. Now, go to your neighbor's house, log onto your web site
>> anonymously and see what the user name is. Unless you require a Windows
>> login, your users all log in to your Internet web site under the
>> anonymous
>> Internet User account.
>>
>> > "Everyone knows something you don't know"

>>
>> A 2-year-old knows nothing that I don't know. Learn from the experience
>> of
>> those who have gone before you before you try to go beyond them. And when
>> you do try to go beyond, be careful that you don't slip. There are no
>> guardrails there.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "David Bienstock" <(E-Mail Removed)> wrote in
>> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>> >I got it to work with a default record having "suser_sname()" in a field
>> >that
>> > I could use
>> > --
>> > "Everyone knows something you don't know"
>> >
>> >
>> > "clintonG" wrote:
>> >
>> >> Ain't gonna happen unless its done on the server and the user has
>> >> logged
>> >> in
>> >> where the name can be retrieved from a database or XML file.
>> >>
>> >>
>> >> <%= Clinton Gallagher
>> >> METROmilwaukee (sm) "A Regional Information Service"
>> >> NET csgallagher AT metromilwaukee.com
>> >> URL http://metromilwaukee.com/
>> >> URL http://clintongallagher.metromilwaukee.com/
>> >>
>> >>
>> >> "David Bienstock" <(E-Mail Removed)> wrote in
>> >> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>> >> > Does anyone have sample code to show the current windows username?
>> >> > I
>> >> > didn't
>> >> > want to run this on the server. Javascript is OK, but I need it in
>> >> > HTML
>> >> > page
>> >> > and .HTM file, so it can't be server-side or ASP.
>> >> >
>> >> > I just want a page that has a title and "You're logged in as:
>> >> > XXXX\YYYY".
>> >> >
>> >> > Any ideas?
>> >> > --
>> >> > "Everyone knows something you don't know"
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      6th May 2005
> 1st of all a 2 year old knows how to behave, unlike you... mostly kidding.

Do you have children? They don't call it "the terrible twos" for nothing!

--

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.


"David Bienstock" <(E-Mail Removed)> wrote in
message news:A889EEE6-7F1E-4686-AFC4-(E-Mail Removed)...
> 1st of all a 2 year old knows how to behave, unlike you... mostly kidding.
>
> Actually because I have OWC hooked into the website it does pull in the
> username.
> --
> "Everyone knows something you don't know"
>
>
> "Kevin Spencer" wrote:
>
>> >I got it to work with a default record having "suser_sname()" in a field
>> >that
>> > I could use
>> > --

>> Okay, smart guy. Now, go to your neighbor's house, log onto your web site
>> anonymously and see what the user name is. Unless you require a Windows
>> login, your users all log in to your Internet web site under the
>> anonymous
>> Internet User account.
>>
>> > "Everyone knows something you don't know"

>>
>> A 2-year-old knows nothing that I don't know. Learn from the experience
>> of
>> those who have gone before you before you try to go beyond them. And when
>> you do try to go beyond, be careful that you don't slip. There are no
>> guardrails there.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "David Bienstock" <(E-Mail Removed)> wrote in
>> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>> >I got it to work with a default record having "suser_sname()" in a field
>> >that
>> > I could use
>> > --
>> > "Everyone knows something you don't know"
>> >
>> >
>> > "clintonG" wrote:
>> >
>> >> Ain't gonna happen unless its done on the server and the user has
>> >> logged
>> >> in
>> >> where the name can be retrieved from a database or XML file.
>> >>
>> >>
>> >> <%= Clinton Gallagher
>> >> METROmilwaukee (sm) "A Regional Information Service"
>> >> NET csgallagher AT metromilwaukee.com
>> >> URL http://metromilwaukee.com/
>> >> URL http://clintongallagher.metromilwaukee.com/
>> >>
>> >>
>> >> "David Bienstock" <(E-Mail Removed)> wrote in
>> >> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>> >> > Does anyone have sample code to show the current windows username?
>> >> > I
>> >> > didn't
>> >> > want to run this on the server. Javascript is OK, but I need it in
>> >> > HTML
>> >> > page
>> >> > and .HTM file, so it can't be server-side or ASP.
>> >> >
>> >> > I just want a page that has a title and "You're logged in as:
>> >> > XXXX\YYYY".
>> >> >
>> >> > Any ideas?
>> >> > --
>> >> > "Everyone knows something you don't know"
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      6th May 2005
One more thing, which may be helpful (I hope). If the OWC is on the client
machine, that is, an ActiveX control in a web page that is on the client
machine, you will get the logged-in user name of the user on that machine,
on the page on that user's machine. So, you will get things like
"Administrator," "Guest," and "Mary." If that's what you want, that will
work. So, for example, if your goal is to display the user's login name TO
the user, your plan will succeed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> 1st of all a 2 year old knows how to behave, unlike you... mostly
>> kidding.

>
> Do you have children? They don't call it "the terrible twos" for nothing!
>
> --
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
>
> "David Bienstock" <(E-Mail Removed)> wrote in
> message news:A889EEE6-7F1E-4686-AFC4-(E-Mail Removed)...
>> 1st of all a 2 year old knows how to behave, unlike you... mostly
>> kidding.
>>
>> Actually because I have OWC hooked into the website it does pull in the
>> username.
>> --
>> "Everyone knows something you don't know"
>>
>>
>> "Kevin Spencer" wrote:
>>
>>> >I got it to work with a default record having "suser_sname()" in a
>>> >field
>>> >that
>>> > I could use
>>> > --
>>> Okay, smart guy. Now, go to your neighbor's house, log onto your web
>>> site
>>> anonymously and see what the user name is. Unless you require a Windows
>>> login, your users all log in to your Internet web site under the
>>> anonymous
>>> Internet User account.
>>>
>>> > "Everyone knows something you don't know"
>>>
>>> A 2-year-old knows nothing that I don't know. Learn from the experience
>>> of
>>> those who have gone before you before you try to go beyond them. And
>>> when
>>> you do try to go beyond, be careful that you don't slip. There are no
>>> guardrails there.
>>>
>>> --
>>> HTH,
>>>
>>> Kevin Spencer
>>> Microsoft MVP
>>> ..Net Developer
>>> What You Seek Is What You Get.
>>>
>>> "David Bienstock" <(E-Mail Removed)> wrote in
>>> message news:70F9CACD-901B-4CB2-90A2-(E-Mail Removed)...
>>> >I got it to work with a default record having "suser_sname()" in a
>>> >field
>>> >that
>>> > I could use
>>> > --
>>> > "Everyone knows something you don't know"
>>> >
>>> >
>>> > "clintonG" wrote:
>>> >
>>> >> Ain't gonna happen unless its done on the server and the user has
>>> >> logged
>>> >> in
>>> >> where the name can be retrieved from a database or XML file.
>>> >>
>>> >>
>>> >> <%= Clinton Gallagher
>>> >> METROmilwaukee (sm) "A Regional Information Service"
>>> >> NET csgallagher AT metromilwaukee.com
>>> >> URL http://metromilwaukee.com/
>>> >> URL http://clintongallagher.metromilwaukee.com/
>>> >>
>>> >>
>>> >> "David Bienstock" <(E-Mail Removed)> wrote in
>>> >> message news:92D921BB-28D5-476D-9AE1-(E-Mail Removed)...
>>> >> > Does anyone have sample code to show the current windows username?
>>> >> > I
>>> >> > didn't
>>> >> > want to run this on the server. Javascript is OK, but I need it in
>>> >> > HTML
>>> >> > page
>>> >> > and .HTM file, so it can't be server-side or ASP.
>>> >> >
>>> >> > I just want a page that has a title and "You're logged in as:
>>> >> > XXXX\YYYY".
>>> >> >
>>> >> > Any ideas?
>>> >> > --
>>> >> > "Everyone knows something you don't know"
>>> >>
>>> >>
>>> >>
>>>
>>>
>>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: Sample code to get data from Excel or Access during a slide show Brian Reilly, MVP Microsoft Powerpoint 0 5th Sep 2007 06:29 PM
How to get current logged in Windows username? John Dalberg Microsoft ASP .NET 6 18th Apr 2005 07:15 PM
Validate Domain Username/Password Sample Code? Scott Lezberg \(Deltek\) Microsoft VB .NET 4 20th May 2004 02:05 PM
question about retreiving info from adminstrator username to current username =?Utf-8?B?c2VwdGVtYmVy?= Windows XP Help 0 5th Jan 2004 03:31 AM
Sample code for macro to forward current displayed item to fixed recipients (dist list)? No Spam Microsoft Outlook VBA Programming 1 30th Nov 2003 04:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 PM.