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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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


    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

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT