Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting PC username

Status
Not open for further replies.

zuza

Programmer
Nov 9, 2003
54
0
0
YU
Hello there,

I want to get PC username with what users loins in their PC ... i try with ->> Request.ServerVariables("LOGON_USER"); but this sometimes is working , sometimes not ... most of the time no. With :
Set ObjNet = CreateObject("WScript.Network")
gsUserName = objNet.UserName
is giving me Username of PC/Server where asp page is posted .. but me I need username or computername of user PC while he opens login page.

Rgds,
ZuZa.
 
Hi

Try

request.servervariables("REMOTE_USER") instead.

That might work.
 
try this:

<%
Set WshNetwork = server.CreateObject(&quot;WScript.Network&quot;)
IntMachinName=WshNetwork.ComputerName
Response.write IntMachinName
%>
 
Same thing,

Is not showing ... I'm wondering if I can do with this :

Private Declare Function GetUserName Lib &quot;advapi32.dll&quot; Alias &quot;GetUserNameA&quot; (ByVal lpBuffer As String, nSize As Long) As Long

Public Function UserName() As String

Dim llReturn As Long
Dim lsUserName As String
Dim lsBuffer As String

lsUserName = &quot;&quot;
lsBuffer = Space$(255)
llReturn = GetUserName(lsBuffer, 255)

End function

But, in ASP where should i put this class code ... maybe in inc file ??

Thanks for help,
ZuZa.
 
know what, my code shows the machine name the server is in not the &quot;user&quot; Oops.
 
Hi all,

I need this too. Or maybe there's another way. The users of my website get a password but they are not allowed to pass it on to other people. So I would also check on PC username. Unless someone else has a better idea ?

Thanx
Buzzer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top