Help! Need to get windows username into HTML form  | | |
July 2nd, 2004, 02:56 PM
|
#1 (permalink)
| | Member
Join Date: Apr 2002 Location: (Rob) Indiana - USA
Posts: 498
| Help! Need to get windows username into HTML form
Ive searched and searched an cannot find a javascript or html command to get a windows users login name into a text field on a form
anyone have any ideas?
i cant use ASP for this since the form can only be .html
Thanks in advance! |
| |
July 2nd, 2004, 05:50 PM
|
#2 (permalink)
| | Member
Join Date: Oct 2002
Posts: 78
|
Um, you could use cookies and a form of some sort...but even in asp.net I don't think such a thing exists. The harmful applications would outdo the good most likely. |
| |
July 2nd, 2004, 08:56 PM
|
#3 (permalink)
| | Member
Join Date: Apr 2002 Location: (Rob) Indiana - USA
Posts: 498
|
i guess i never thought of the bad things
what i'm doing is i have a web based paging system and the user is required to enter their name, i would like for them to not have to enter it every time they page someone
i guess i'll just use cookies and a javascript to prompt them for their name the first time |
| |
July 2nd, 2004, 09:14 PM
|
#4 (permalink)
| | Member
Join Date: Jul 2003
Posts: 38
|
you might want to look into programs like winbar and sysmetrix, try to find out how they are getting the username information...i dont know...
__________________
:/
|
| |
July 2nd, 2004, 10:04 PM
|
#5 (permalink)
| | Member
Join Date: Apr 2002 Location: (Rob) Indiana - USA
Posts: 498
|
ive never used cookies with website before, anyone know of a good place that deals with using javascript and cookies? |
| |
July 2nd, 2004, 11:39 PM
|
#6 (permalink)
| | Member
Join Date: Jan 2004
Posts: 85
| |
| |
July 3rd, 2004, 12:30 AM
|
#7 (permalink)
| | Member
Join Date: Jun 2004 Location: usa
Posts: 250
|
the folowing html can be used and the vbscript will display username.
Maybe you can fine tune it to
<!-- The Name of this File = test2.html --><HTML>
<HEAD> <TITLE>VBScript ->Getting UserName</TITLE>
<SCRIPT LANGUAGE="VBScript">
Dim objNet
On Error Resume Next 'If fail to create object then display error
' (press no message)
Set objNet = CreateObject("WScript.NetWork")
If Err.Number <> 0 Then 'If err
MsgBox "Do not press ""No"" If your browser warns you."
Document.Location = "test2.html" 'Display document by placing name again
End if
Dim strInfo
strInfo = "User Name is " & objNet.UserName & vbCRLF & _
"Computer Name is " & objNet.ComputerName & vbCRLF & _
"Domain Name is " & objNet.UserDomain
MsgBox strInfo
Set objNet = Nothing 'Destroy the Object
</SCRIPT>
</HEAD>
<BODY>
<H1 align="center">That's It</H1>
<H4 align="center">NoseBleeD@TechIMO<BR></H4>
</BODY>
</HTML> |
| |
July 3rd, 2004, 01:12 AM
|
#8 (permalink)
| | Member
Join Date: Apr 2002 Location: (Rob) Indiana - USA
Posts: 498
|
awesome! i'll try that tomorrow, and check w3schools
this seems so simple to do yet i'm having such a hard time with it...
damn i love this place  |
| |
August 1st, 2007, 04:00 PM
|
#9 (permalink)
| | Junior Member
Join Date: Aug 2007
Posts: 2
|
Hey noseBleeD,
I'm a new kid on the block, but that code worked well, but how can you get it into an HTML form? Better yet, if I wanted to send and email using the username or "alias" as my company calls it, how could I put the username in the CC: when using Outlook? |
| |
August 10th, 2007, 02:04 PM
|
#10 (permalink)
| | Junior Member
Join Date: Aug 2007
Posts: 2
| |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |