Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > computer username display

Reply
Thread Tools

computer username display

 
 
jason via DotNetMonster.com
Guest
Posts: n/a
 
      07-01-2005
i am planning to add something that can capture the windows username in it
and then i will save it to my database for further refference

but how will the coding look like?
i am new in asp.net so.. any idea?
as far as i noe.. this line of code is to show the pc name right?
Dim a As String = Environment.UserDomainName

then how about showing the windows user name?

... Dim hostName As String = Dns.GetHostName()

this one?
but there is an error asking me to declare the dns..? waht should i declare?
should this code works?
thanks..
 
Reply With Quote
 
 
 
 
Aaron Corcoran
Guest
Posts: n/a
 
      07-01-2005
Jason,

If you want to capture the user that is currently logged into your
application, assuming you are using Integrated Authentication, simply
put the following line of code:

Dim strUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.ToString()

This code will reveal a string in the format of DOMAIN\username.

I hope this helps!
Aaron

 
Reply With Quote
 
 
 
 
\jason via DotNetMonster.com\
Guest
Posts: n/a
 
      07-06-2005
yupe... i got another different code that helps.. thanks a lot..~ oh.. by the
way.. do u noe how to send email in asp.net using vb.net? bust i don wish to
add the coding in the htmlform... actually i got one that all the html coded
inside.. but when i modify something..all the layout will be changed
completely automatically.. i just need 2 textbox for the user to key in and
then when he or she press the summit button, it will be sent to me... with
all the data he or shse typed inside..

thanks..`
Aaron Corcoran wrote:
>Jason,
>
>If you want to capture the user that is currently logged into your
>application, assuming you are using Integrated Authentication, simply
>put the following line of code:
>
>Dim strUser As String =
>System.Security.Principal.WindowsIdentity.GetCurr ent.Name.ToString()
>
>This code will reveal a string in the format of DOMAIN\username.
>
>I hope this helps!
>Aaron



--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200507/1
 
Reply With Quote
 
Aaron Corcoran
Guest
Posts: n/a
 
      07-07-2005
Jason,

The following link should aid you on your journey:

http://www.sitepoint.com/article/sen...-email-asp-net

Aaron

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
loginview control displays network username instead of (web) username Shailesh Patel ASP .Net Web Controls 0 11-08-2006 08:19 PM
How can I display the text <%username%>? JJ ASP .Net 1 10-31-2006 07:40 PM
Display username from AD in ASP/.NET page VM ASP .Net 1 09-27-2006 09:14 AM
Display (no's and username) logged in users! Arvind R ASP .Net 3 11-19-2005 11:12 AM
Change the username found in "C:\Documents and Settings\Username" The Reluctant Robot Named Jude Computer Support 1 05-05-2004 07:11 AM



Advertisments