473,804 Members | 3,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'System.Managem ent.ManagementC lass' is not defined

I am getting this error: Type 'System.Managem ent.ManagementC lass' is not
defined. The statement is:
Dim diskClass As New System.Manageme nt.ManagementCl ass("Win32_Logi calDisk")
According to the help file, this 'System.Managem ent.ManagementC lass' is
under System.Object, so I put in the

Imports System.Object
in namespace, but that seems not to help.

Any suggestions?
Thanx in advance,
--
Anil Gupte
www.keeninc.net
www.icinema.com
Nov 26 '06 #1
3 23334
Anil Gupte wrote:
I am getting this error: Type 'System.Managem ent.ManagementC lass' is
not defined. The statement is:
Dim diskClass As New
System.Manageme nt.ManagementCl ass("Win32_Logi calDisk")
You need to add a reference to System.Manageme nt.dll, then it'll work.

HTH,

--

(O)enone
Nov 26 '06 #2
Thanx! That worked!

--
Anil Gupte
www.keeninc.net
www.icinema.com

"Oenone" <oe****@nowhere .comwrote in message
news:9A******** ***********@new sfe2-win.ntli.net...
Anil Gupte wrote:
>I am getting this error: Type 'System.Managem ent.ManagementC lass' is
not defined. The statement is:
Dim diskClass As New
System.Managem ent.ManagementC lass("Win32_Log icalDisk")

You need to add a reference to System.Manageme nt.dll, then it'll work.

HTH,

--

(O)enone

Nov 26 '06 #3
As I said it helpd, but raises another question.

What other options are there other than Win32_LogicalDi sk? I want only
local Read/Write Disks (I wan tot create a temporary file and I am trying to
find the first disk that has enough space and I can write to).

I did a searh in the help, but came up with nothing. There is some code:
Dim diskClass As New System.Manageme nt.ManagementCl ass("Win32_Logi calDisk")

Dim disks As System.Manageme nt.ManagementOb jectCollection =
diskClass.GetIn stances()

Dim disk As System.Manageme nt.ManagementOb ject

Dim space As System.UInt64

For Each disk In disks

If CStr(disk("Name ")) = "C:" Then

space = CType(disk("Fre eSpace"), System.UInt64)

End If

Next disk

But this does not help because it is Logical disk. I know there is an
IsLocal property, but I wish there was a more direct way and also, will
IsLocal give me the CD-ROM drive, which obviously I cannot write to.

Thanx in advance,
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Oenone" <oe****@nowhere .comwrote in message
news:9A******** ***********@new sfe2-win.ntli.net...
Anil Gupte wrote:
>I am getting this error: Type 'System.Managem ent.ManagementC lass' is
not defined. The statement is:
Dim diskClass As New
System.Managem ent.ManagementC lass("Win32_Log icalDisk")

You need to add a reference to System.Manageme nt.dll, then it'll work.

HTH,

--

(O)enone

Nov 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1591
by: ------------------ eric -------------------- | last post by:
Any idea how to reboot a givin machine useing the ststem.management namespace? thanks eric.
2
14050
by: Paul Gronka | last post by:
I've got a VB.NET windows application (written in VS .NET 2003) that makes a call to WMI for retrieving the MAC Address from the client's PC. It works on 4 out of the 5 PC's tested so far. All the workstations are DELLs running XP SP1a with the 1.1 .NET Framework. The following line of code generates an exception on the one PC: Dim oMac As New System.Management.ManagementClass("Win32_NetworkAdapterConfiguration") The error it...
0
2288
by: Helge Jensen | last post by:
Having posted in microsoft.public.dotnet.framework.sdk and microsoft.public.dotnet.framework.wmi without receiving any response, I posthere on the off-chance that someone who isn't following those groups knows a solution. I'm using code (roughly like): using System; using System.Management; public class Foo {
9
10910
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
1
10275
by: lcifers | last post by:
I have an application that uses the following code to return the default printer: Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim mo As Management.ManagementObject moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Printer")
0
2309
by: Gancy | last post by:
Hello, The code below enumerates all products installed on any given machine. Through System.Management i can also find WMI methods that could be exected. But i have not worked on WMI and System.Management before, i need to know how to execute the those mehtods ConnectionOptions options = new ConnectionOptions(); options.Authority = "NTLMDOMAIN:DOMAIN_X";
1
1554
by: news.orange.nl | last post by:
System.Management does not seem to import when I use Visual Web Developer 2005 Express Edition I put <%@ Import Namespace="System.Management" %> in my code. asp page If I put
0
1475
by: MartijnHoekstra | last post by:
Hi there, I understand there is no easy single answer to the question I have. I struggled last 5 days searching for the right way to: Read DMI (Desktop Management Information ) data provided by a 3rd party legacy application by use of the C#'s System.Management. The attributes of the 3rd party are defined in a .mif file. So far I came up with, mapping the mif file into a wbem's mof file to act as a DMI client. But sofar no luck in...
1
6789
Ravi L
by: Ravi L | last post by:
I have created a windows Service which invokes executables on remote machines, waits for it to complete and then proceeds to the next machine on the network. The Account type for the windows Service is "Network Service". For monitoring if the process is completed on the remote machine, I am using ManagementEventWatcher class. I get the following error when I start the Management event watcher object. System.Management.ManagementException:...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.