"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.
|