PC Review


Reply
Thread Tools Rate Thread

System.Management namespace

 
 
=?Utf-8?B?UGF1bFRob21hcw==?=
Guest
Posts: n/a
 
      23rd Jun 2005
I am using VS.Net 2000 and C# trying to access the System.Management
namespace in a Web Application -but- after:
using System;
using System.Management;
I get:
The type or namespace name "Management" does not exist in the class or
namespace "System"
How do I go about accessing the "Management" namespace...
I am trying to get the Serial Number of the CPU and Operating System from
examples I have found like:
//ManagementObjectSearcher searcher = new
//ManagementObjectSearcher("select * from win32_share");
//string MgmtTemp;
//foreach (ManagementObject share in searcher.Get())
// {
// // Console.WriteLine("Share = " + share["Name"]);
// MgmtTemp = share["Name"];
// }
There seems to be different limitations between Windows Applications "Forms"
and Web Applications - Why - aren't they both using the .Net
Framework/Runtime???
Thanks in advance,
Paul

 
Reply With Quote
 
 
 
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      25th Jun 2005

"PaulThomas" <(E-Mail Removed)> wrote in message
news:F5AF2B17-9CB1-40F4-BECB-(E-Mail Removed)...
>I am using VS.Net 2000 and C# trying to access the System.Management
> namespace in a Web Application -but- after:
> using System;
> using System.Management;
> I get:
> The type or namespace name "Management" does not exist in the class or
> namespace "System"
> How do I go about accessing the "Management" namespace...
> I am trying to get the Serial Number of the CPU and Operating System from
> examples I have found like:
> //ManagementObjectSearcher searcher = new
> //ManagementObjectSearcher("select * from win32_share");
> //string MgmtTemp;
> //foreach (ManagementObject share in searcher.Get())
> // {
> // // Console.WriteLine("Share = " + share["Name"]);
> // MgmtTemp = share["Name"];
> // }
> There seems to be different limitations between Windows Applications
> "Forms"
> and Web Applications - Why - aren't they both using the .Net
> Framework/Runtime???
> Thanks in advance,
> Paul
>


There are no "different limitations", for both you have to add a reference
to the System.Management.dll. assembly when compiling.
VS will automatically add following entry to your web config file when you
add an assembly reference...

<assemblies>

<add assembly="System.Management, Version=....."/>

Willy.





 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Management Namespace TomR Microsoft VB .NET 0 24th Sep 2009 10:59 PM
System.Management.Instrumentation namespace Samuel Shulman Microsoft VB .NET 0 5th May 2006 12:14 AM
System.Management Namespace =?Utf-8?B?VFJX?= Microsoft C# .NET 2 17th Mar 2005 03:43 PM
How do i shutdown my system using System.Management namespace? Bredal Jensen Microsoft C# .NET 2 7th Oct 2004 12:16 PM
System.Management namespace Mr B Microsoft C# .NET 1 19th Jan 2004 05:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:05 AM.