Visual Basic.NET
  Home arrow Visual Basic.NET arrow Retrieving Networking Configuration Inform...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Retrieving Networking Configuration Information Using Visual Basic.NET and VBScript
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 10
    2006-01-11

    Table of Contents:
  • Retrieving Networking Configuration Information Using Visual Basic.NET and VBScript
  • How to List all IPAddresses of a computer using Visual Basic.NET – the code
  • How to retrieve MAC address and other miscellaneous network information using Visual Basic.NET – preparing the wrapper
  • How to retrieve MAC address and other miscellaneous network information using Visual Basic.NET – the code
  • How to retrieve Network Client Information using Visual Basic.NET
  • How to retrieve Win Proxy Information using Visual Basic.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Retrieving Networking Configuration Information Using Visual Basic.NET and VBScript
    (Page 1 of 6 )

    This article explains how to retrieve “Network settings” information dynamically using Visual Basic.NET and VBScript.
    A downloadable file for this article is available here.

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition.  But, I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.

    I contributed several articles on WMI with VB.NET and VBScript previously(including a number that cover introductory or basic topics of WMI).  I even contributed a series (of about six articles) on “WMI Programming on VB.NET” covering several aspects of WMI.  I strongly suggest that you go through the series before going through this article.

    How to list all IP addresses of a computer using Visual Basic.NET – preparing the wrapper

    Before getting the information of “IPAddresses”, we need to create wrapper to store the “IPAddress” information.  Let us proceed with creating a wrapper:

    Public Function getNetworkInfoStructure() As DataTable
            Dim dt As New DataTable
            dt.Columns.Add(New DataColumn("Caption"))
            dt.Columns.Add(New DataColumn("Description"))
            dt.Columns.Add(New DataColumn("DHCPEnabled"))
            dt.Columns.Add(New DataColumn("DHCPServer"))
            dt.Columns.Add(New DataColumn("DNSDomain"))
            dt.Columns.Add(New DataColumn("DNSHostName"))
            dt.Columns.Add(New DataColumn("IPAddress"))
            Return dt
        End Function

    The following method “addNetworkInfo” adds a single row based on the structure you create for the data table using the above method.

        Public Sub addNetworkInfo(ByRef dt As DataTable, ByVal Caption As String, ByVal Description As String, ByVal DHCPEnabled As String, ByVal DHCPServer As String, ByVal DNSDomain As String, ByVal DNSHostName As String, ByVal IPAddress As String)
            Dim dr As DataRow
            dr = dt.NewRow
            dr("Caption") = Caption
            dr("Description") = Description
            dr("DHCPEnabled") = DHCPEnabled
            dr("DHCPServer") = DHCPServer
            dr("DNSDomain") = DNSDomain
            dr("DNSHostName") = DNSHostName
            dr("IPAddress") = IPAddress
            dt.Rows.Add(dr)
        End Sub   

    At the moment, I didn’t give the subnet for the IP Address to be listed.  But you can have it through “IPSubmit”.  You just need to add that as part of the structure to get it listed. 

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · [i]This article explains how to retrieve “Network settings” information dynamically...
       · This is a very good article, but a little insight on adding a reference for...
       · Hello,Actually, within the same article I already added the following...
     

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway