Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2005, 11:49 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default How to fetch LAN Card Number????

hi everyone,

is thr a way to fetch my cpmputer's LAN Card's Number???
any help would be appreciated.


thnx

Ashu


 
Old July 14th, 2005, 02:23 AM
Authorized User
 
Join Date: Feb 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
I fund this code on the net. I hope it is helpfull.

Set fs = CreateObject("Scripting.FileSystemObject")
Set outFile = fs.CreateTextFile("NetworkAdapterConfiguration.txt ", True)
For each Item in GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf ("Win32_NetworkAdapterConfiguration")
'outFile.WriteLine("DefaultIpGateway: " & Item.DefaultIpGateway)
'outFile.WriteLine("DNSServerSearchOrder: " & Item.DNSServerSearchOrder)
'outFile.WriteLine("IPaddress: " & Item.IPaddress)
'outFile.WriteLine("IPsubnet: " & Item.IPsubnet)
'outFile.WriteLine("WinsPrimaryServer: " & Item.WinsPrimaryServer)

outFile.WriteLine("Description: " & Item.Description)
outFile.WriteLine("DHCPenabled: " & Item.DHCPenabled) 'This item is Read/Write (-1: if DHCP is not enabled, 0: not enabled, 1: DHCP enabled)
outFile.WriteLine("DHCPLeaseObtained: " & Item.DHCPLeaseObtained)
outFile.WriteLine("DHCPLeaseExpires: " & Item.DHCPLeaseExpires)
outFile.WriteLine("DHCPServer: " & Item.DHCPServer)
outFile.WriteLine("DNSHostname: " & Item.DNSHostname)
outFile.WriteLine("DNSDomain: " & Item.DNSDomain)
outFile.WriteLine("IPenabled: " & Item.IPenabled)
outFile.WriteLine("MACAddress: " & Item.MACAddress)
outFile.WriteLine("")
Next
outFile.Close

Cheers
Karsten

 
Old July 14th, 2005, 09:28 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

hi

thnx for the quick reply.
i will try the code and let u know

thnx again

Ashu:)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocking a user in LAN dvp10 .NET Framework 2.0 6 September 16th, 2009 08:40 AM
Fetch Data From server ashvinm JSP Basics 2 March 10th, 2008 07:48 AM
Wake on Lan perecarl VBScript 1 January 18th, 2007 04:03 AM
How copy Any file on LAN Rahul Gupta Pro VB 6 1 March 21st, 2006 09:43 AM
fetch in background? RCC_msolomon ADO.NET 6 June 25th, 2003 10:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.