473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

computer username display

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..
Nov 19 '05 #1
3 1396
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

Nov 19 '05 #2
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
Nov 19 '05 #3
Jason,

The following link should aid you on your journey:

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

Aaron

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jim Scheffler | last post by:
I'm new to VB.NET programming and would like some help on a little project I've got going. How would I go about getting computer information on my local computer, i.e. serial number, hard drive...
6
by: Bob Lin | last post by:
I would like to display the hostname (or computername) and username (or logonID) on our Intranet support page. I saved the following vbs code as asp file, but it doesn't display the username. No...
3
by: RR | last post by:
I'm developing a web app and, for the user's convenience, I'd like to display their local computer name (i.e. the name of the computer the browser is running on). I've looked very hard to find a...
2
by: Whitney | last post by:
I've been going bonkers trying to find the answer to this question... I'm hoping somebody out there can help me. Our network environment is Active Directory and our web server is Windows 2003 IIS...
0
by: Kenneth Keeley | last post by:
Hi, I have been working on a Login page that uses ADSI to authenicate the users. I had this all working on my test system and on a second system connected to the live domain. Now it will only work...
12
by: Cecil | last post by:
Does this make sense for a logon table: CREATE TABLE Logon ( ID INT NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(15) NOT NULL, password VARCHAR(15) NOT NULL ) GO CREATE UNIQUE INDEX...
1
by: kowndinya | last post by:
i want to know the username who is working on a particular computer.(Remote computer) I know already the computer name which is listed in a combo box. Is there any way to get username? please...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
12
by: marylipscomb | last post by:
I am trying to test with a hard coded username and password and I do not know how to put them in my code. For example say I want my username to be mary and password to be pass for testing purposes. ...
2
by: brett | last post by:
ok, it appears that i have run into a spot that i am not able to figure out on my own. Let me first say that i have hobbled together this SUB from things i found on the internet and tutorials....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.