Results 1 to 13 of 13

Thread: VB.NET vs VB.NET Pro

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    7

    VB.NET vs VB.NET Pro

    I am a very new newbie, having started working with VB only this morning. So be gentle, k?

    I do have PHP and JS programming experience, so I have an idea of what I'm doing, and I am working through a book that I bought ("Learning Visual Basic.NET through Applications"). For those that may have the book I'm in Chapter 13, creating a system information window.

    I'm having problems with this line of code:
    Imports System.Management
    In the code window in VB I get the squiggly blue line under it - VB doesn't recognize the namespace. This book spends an entire chapter with code based off of stuff obtained after this line of code is run, and it's repeated several times during various code listings, so I would be suprised if this code were wrong.

    Just as an example of what is supposed to then be available, here is a bit of the proceeding code:
    VB Code:
    1. Public Class Form1
    2.     Inherits System.Windows.Forms.Form
    3. #Region " Windows Form Designer generated code "
    4. 'snipped for brevity
    5. #End Region
    6.  
    7.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    8.         Dim mc As ManagementClass
    9.         Dim mo As ManagementObject
    10.         mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
    11.         Dim moc As ManagementObjectCollection = mc.GetInstances()
    12.         ListBox1.Items.Add("Network Information")
    13.         ListBox1.Items.Add("-------------------")
    14.         For Each mo In moc
    15.             If mo.Item("IPEnabled") = True Then
    16.                 ListBox1.Items.Add("MAC Address : " & mo.Item("MacAddress").ToString())
    17.                 ListBox1.Items.Add("Description : " & mo.Item("Description").ToString())
    18.             End If
    19.         Next

    My question is, is the book wrong (#1) and #2, if the book is right, does this have something to do with the fact that I bought VB.NET (the ~$120 version) as opposed to VB.NET Pro that only comes with VS.NET?

    Any help would be very much appreciated.
    Last edited by tubedogg; Nov 17th, 2002 at 06:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width