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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAC Address using VB

Status
Not open for further replies.

saimagulse

Programmer
Aug 5, 2006
9
0
0
PK
In dos prompt when we run ipconfig we get information about mac address how can i get it using VB?
How can i protect my application to run to specifice user? which is the best methood for it?
 
UserName?
Try;

'return network user name
Public Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long

Public Function NetUserName$()

Dim User$, nLen&, lret&

NetUserName$ = "No LAN"
nLen = 255
User$ = String$(nLen, 0)
lret = WNetGetUser(vbNullString, User, nLen)
If lret = 0 Then NetUserName$ = Left$(User$, InStr(User, Chr$(0)) - 1)

End Function

regards Hugh
 
Mac Address?

Googling for 'vb6 get mac address' appears to have answers.
 
Why google? I've certainly shown how to do it in this very forum on several occassions. So a keyword search here should suffice. Here, I'll do it for you ... here we go, a thread with both a classical API solution AND a WMI solution: thread222-874992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top