Mac Address

Mac Address

Postby Silvio » Sun May 31, 2009 9:28 am

How read a Mac Address of a pc ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Mac Address

Postby pablovidal » Sun May 31, 2009 11:57 am

Code: Select all  Expand view
GetNetCardId()
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Re: Mac Address

Postby Silvio » Sun May 31, 2009 12:09 pm

I try it allready but it return a array ....
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Mac Address

Postby Marc Vanzegbroeck » Sun May 31, 2009 2:21 pm

If you have more then one network-connection, the functions returs an array, otherwise you directly get the MAC-adres

see http://forums.fivetechsupport.com/viewtopic.php?f=3&t=9631&p=46355&hilit=getnetcardid#p46355

Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Mac Address

Postby Willi Quintana » Sun May 31, 2009 4:06 pm

Hi SIlvio:

Function GetMacAdd()
local aMac, cRet

TRY
aMac := GetNetCardID()
CATCH
aMac := ""
END

IF VALTYPE(aMac) = "U" // no hay tarjera de red instalada
Return("")
EndIf
IF VALTYPE(aMac) = "A" // hay varias tarjetas de red
If LEN(aMac) = 0
cRet := ""
Else
cRet := aMac[1]
EndIf
EndIf
If VALTYPE(aMac) = "C"
cRet := aMac // una sola t de red
EndIf
Return(cRet)
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Mac Address

Postby Silvio » Sun May 31, 2009 5:52 pm

but for each computer there an unique mac address???
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Mac Address

Postby Rick Lipkin » Sun May 31, 2009 10:47 pm

Each ethernet card has a unique mac address .. it is the network card not the computer. Some computers may have more than one ethernet card in them .. that is why you may get the array with multiple addresses.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Mac Address

Postby Silvio » Mon Jun 01, 2009 9:16 am

I want protect My application with this system but I can have one pc not with net card ... and then How I protect it ?
How can read the key serial of the computer ( no hdserial)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Mac Address

Postby Rick Lipkin » Mon Jun 01, 2009 1:16 pm

Silvo

There is NO good answer .. I am in State gov here with over 4k users .. One thing that I can tell you .. computers get moved, network cards go bad, infrastructure changes, new computers are always moved in and put in place, virus cause all kinds of problems and hard drives that have to be re-formatted ..

Just don't think a 'perfect' solution would be to rely on a Mac address .. just too much of a ( possible ) moving target. If you are looking at a small group of people using your application .. perhaps a 'dongle' attached to a serial, usb or parallel port wouild be better ..

Just my 2 cents worth ..

Rick
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 106 guests