?
Solved

How to get the user/password of client machine ?

Posted on 2002-05-30
5
Medium Priority
?
151 Views
Last Modified: 2010-05-02
How can I get the User name/password of the local machine used to log on BY THE LOCAL user.

0
Comment
Question by:chirawa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
xSinbad earned 200 total points
ID: 7046257
I dont know about getting the password but have a look at these two examples

Username in NT msgbox environ("UserName")

or

API

Declare Function GetUserName Lib "advapi32" Alias "GetUserNameA" (ByVal strName As String, ByRef dwLength As Long) As Long

intLen = 50
strUserID = Space(intLen + 1)
GetUserName strUserID, intLen
strUserID = Left(strUserID, intLen - 1)
msgbox strUserID

(TimCottee  - Q_20219899)

http://www.vbcode.com/asp/showsn.asp?theID=1075 
http://www.vbcode.com/asp/showsn.asp?theID=3795
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7046269
Retrieve user name

Option Explicit

Private Const UNKNOWN = _
"(Value Unknown Because System Call Failed)"

Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize _
As Long) As Long

Public Function GetCurrentUserName() As String

Dim l As Long
Dim sUser As String

sUser = Space$(255)
l = GetUserName(sUser, 255)

'strip null terminator

If l <> 0 Then
   GetCurrentUserName = Left(sUser, InStr(sUser, Chr(0)) - 1)
Else
   Err.Raise Err.LastDllError, , _
     "A system call returned an error code of " _
      & Err.LastDllError
End If

End Function


Private Sub Form_Load()
    MsgBox GetCurrentUserName()
End Sub



Retrieve Password? Researching.

hongjun
0
 
LVL 2

Expert Comment

by:ventond
ID: 7048022
Hopefully the password is not stored, therefore unreturnable.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7851310
Hi chirawa,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept xSinbad's comment(s) as an answer.

chirawa, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7912899
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question