I am a very new newbie, having started working with VB only this morning. :D 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:
Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " 'snipped for brevity #End Region Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mc As ManagementClass Dim mo As ManagementObject mc = New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances() ListBox1.Items.Add("Network Information") ListBox1.Items.Add("-------------------") For Each mo In moc If mo.Item("IPEnabled") = True Then ListBox1.Items.Add("MAC Address : " & mo.Item("MacAddress").ToString()) ListBox1.Items.Add("Description : " & mo.Item("Description").ToString()) End If 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. :)
