Dirección MAC

HMG en Español

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Dirección MAC

Post by danielmaximiliano »

Hola a todos

se agrego al grid la direccion IPv4 e IPv6 de la placa de red conectada a internet que suministra el proveedor o direccion interna dada por el servidor DHCP local.

el GRID muestra las placas de red físicas disponibles

se elimino codigo redundante

se necesita limpiar un poco el codigo fuente eliminando las variables no usadas.

Translate Google

Hello everyone

grid is added to the IPv4 and IPv6 address of the network card connected to Internet provider that provides or internal direction given by the local DHCP server.

GRID displays the physical network plates available

redundant code was removed

needs to be cleaned a bit the source code by removing unused variables.
2014-01-30 22_12_00-AdapterInfo().jpg
2014-01-30 22_12_00-AdapterInfo().jpg (44.77 KiB) Viewed 4098 times
AdapterInfo.rar
(7.27 KiB) Downloaded 307 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Dirección MAC

Post by danielmaximiliano »

Enjoy
AdapterInfo 3.rar
Clean source code
(13.19 KiB) Downloaded 345 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Dirección MAC

Post by andyglezl »

Hola a todos
Tomando el ejemplo posteado por Maximiliano pude lograr esta Función espero les sirva:
(Aclaro que solo lo he probado en mi PC)
--------------------------------------------------------------------------------------
Hello everyone
Taking the example posted by Maximilian I could achieve this function hope they serve:
(I must say that I have only tried on my PC)

Code: Select all

*-------------------------------------------------------------------------------------------
FUNCTION SysInvent()   //  By AndyGlezL
	LOCAL obj, cpu, nInd, obj1, obj2
	
	WaitWindow( "Espere, Leyendo...", .T. )
	
	oLocator := win_oleCreateObject( "wbemScripting.SwbemLocator" )
	oWmi     := oLocator:ConnectServer()
	*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	data1:=""
	oCollection:= oWMI:ExecQuery("Select * from Win32_ComputerSystem")
	For Each obj In oCollection
		Name  := 'Computer: '+CHR(9)+obj:Name
		PhysicalMemory := 'PhysicalMemory: '  + CHR(9) + STR( ( VAL( obj:TotalPhysicalMemory) / 1000000 ) / 1024 ) + " GB."
		cNumProcs      := "# of Processors: " + CHR(9) + STR( obj:NumberOfProcessors )
		data1 += Name+CRLF+cNumProcs+CRLF+PhysicalMemory
	Next
	data2:=""
	oCollection := oWMI:ExecQuery("Select * from Win32_OperatingSystem")
	For Each obj In oCollection
		Caption    := 'OS: '           + CHR(9) + obj:Caption + CRLF
		ServPack   := 'Service Pack: ' + CHR(9) + STR( obj:ServicePackMajorVersion ) + CRLF
		cVersion   := "Version:      " + CHR(9) + obj:Version + CRLF 
		FreePhysMem:= 'FreePhysMemory: '+CHR(9) + STR( ( VAL( obj:FreePhysicalMemory ) / 1000 ) / 1024 ) + " GB." + CRLF
		cWinDir    := "Win Directory:" + CHR(9) + obj:WindowsDirectory
		data2 += Caption+ServPack+cVersion+FreePhysMem+cWinDir
	Next
	data3:=""
	oCollection := oWMI:ExecQuery( 'select * from Win32_ComputerSystemProduct' )
	For Each obj In  oCollection
		Vendor := 'Manufacturer: '+CHR(9)+obj:Vendor
		Name   := 'MotherBoard: '+CHR(9)+obj:Name
		IdentifyingNumber := 'Id. Number: '+CHR(9)+obj:IdentifyingNumber
		data3 += Vendor+CRLF+Name+CRLF+IdentifyingNumber
	Next
	data4 := ""
	nInd  := 0
	oCollection := oWMI:ExecQuery("Select * from Win32_DiskDrive")
	For Each obj In oCollection
		nInd++
		Model         := 'Disc Model'+ALLTRIM(STR(nInd))+': '+CHR(9)+obj:Model+CRLF
		*SerialNumber := 'SerialNumber: '+obj:SerialNumber                   // ERROR !   ?????
		InterfaceType := '   Interface'+ALLTRIM(STR(nInd))+': '+CHR(9)+obj:InterfaceType+CRLF
		Size          := '   Disc.Size'+ALLTRIM(STR(nInd))+': '+CHR(9)+STR( ( VAL( obj:Size ) / 1000000 ) / 1024 )+" GB."+CRLF
		Partitions    := '   Partitions'+ALLTRIM(STR(nInd))+': '+CHR(9)+STR( obj:Partitions )+CRLF
		data4 += Model+InterfaceType+Size+Partitions
	Next
	data5 := ""
	oCollection := oWMI:ExecQuery( 'select * from Win32_Processor' )
	For Each cpu In oCollection
		*DeviceID      := 'DeviceID: '+CHR(9)+cpu:DeviceID+CRLF
		*Availability  := 'Availability: '+CHR(9)+STR( cpu:Availability )+CRLF
		AddressWidth  := 'AddressWidth: '+CHR(9)+STR( cpu:AddressWidth )+CRLF
		*CpuStatus     := 'CpuStatus: '+CHR(9)+STR( cpu:CpuStatus )+CRLF
		CurClockSpeed := 'ClockSpeed: '+CHR(9)+STR( cpu:CurrentClockSpeed )+CRLF
		*MaxClockSpeed := 'MaxClockSpeed: '+CHR(9)+STR( cpu:MaxClockSpeed )+CRLF
		L2CacheSize   := 'L2CacheSize: '+CHR(9)+STR( cpu:L2CacheSize )+CRLF
		L2CacheSpeed  := 'L2CacheSpeed: '+CHR(9)+STR( cpu:L2CacheSpeed )+CRLF
		Name          := 'Name: '+ALLTRIM(cpu:Name)
		*data5 += DeviceID+Availability+AddressWidth+CpuStatus+CurClockSpeed+MaxClockSpeed+L2CacheSize+L2CacheSpeed+Name
		data5 += AddressWidth+CurClockSpeed+L2CacheSize+L2CacheSpeed+Name
	Next
	data6 := ""
	nInd  := 0
	aNetConnectStat := { 'Disconnected', 'Connecting', 'Connected', 'Disconnecting', 'Hardware not present', 'Hardware disabled', 'Hardware malfunction', ;
						 'Media disconnected', 'Authenticating', 'Authentication succeeded', 'Authentication failed', 'Invalid address', 'Credentials required' }
	
	oCollection1 := oWMI:ExecQuery( "SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT\\%'" )
	oCollection2 := oWMI:ExecQuery( 'SELECT * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE' )
	For Each obj1 In oCollection1
		nTemp := obj1:NetConnectionStatus
		For Each obj2 In oCollection2
			nInd++
			cDescrip := 'Description'+ALLTRIM(STR(nInd))+': '+CHR(9)+SUBSTR( obj2:description, 1, AT( "-", obj2:description ) -2 )+' / '+aNetConnectStat[ nTemp+1 ]+CRLF
			ServiceName := '   ServiceName'+ALLTRIM(STR(nInd))+': '+CHR(9)+obj2:ServiceName(0)+CRLF
			IPAddress   := '   IPAddress'+ALLTRIM(STR(nInd))+': '+CHR(9)+obj2:IPAddress(0)+CRLF
			*DefaultIPGateway := 'DefaultIPGateway: '+obj:DefaultIPGateway(0) 		// ERROR !   ????
			MACAddress  := '   MACAddress'+ALLTRIM(STR(nInd))+': '+CHR(9)+obj2:MACAddress(0)
			data6 += cDescrip+ServiceName+IPAddress+MACAddress+CRLF
		Next
	Next
	
	oCollection := 0
	oWMI := 0
	WaitWindow( )
	MsgInfo(data1+CRLF+ ; // REPLICATE( "-", 80 )+CRLF+ ;
			data2+CRLF+REPLICATE( "-", 80 )+CRLF+ ;
			data3+CRLF+REPLICATE( "-", 80 )+CRLF+ ;
			data4+CRLF+REPLICATE( "-", 80 )+CRLF+ ;
			data5+CRLF+REPLICATE( "-", 80 )+CRLF+ ;
			data6, 'System Inventory - By AndyGlezL' )
RETURN nil
Attachments
sysinfo.jpg
sysinfo.jpg (62.57 KiB) Viewed 4025 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Dirección MAC

Post by danielmaximiliano »

Muy bueno Andrés !!!!

Slds
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Dirección MAC

Post by Javier Tovar »

Excelente Andres!

Saludos
User avatar
edufloriv
Posts: 237
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
Location: PERU

Re: Dirección MAC

Post by edufloriv »

Que genial !! gracias por su tiempo amigos y por compartir.


Saludos

Eduardo Flores Rivas


LIMA - PERU
Post Reply