Hey guys I am working on a application, that will pull our inventory
campus wide. I'm having troubles getting it to pull our software serial
numbers. It keeps throwing a Exception when it gets to that point.
Below is the code I am using. If someone could give me a few ideas. The
app is in Console form now to be translated to a Windows App at a
future date.
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
queryCollection1 = query1.Get();
foreach (ManagementObject mo in queryCollection1)
{
Console.WriteLine("Product : " +
mo["Name"].ToString());
Console.WriteLine("Serial : " +
mo["ProductID"].ToString());
}
Thanks-
Evan Sparkman 5 5144
Evan,
Exactly which line is the exception being thrown on?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"esparkman" <ev***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Hey guys I am working on a application, that will pull our inventory
campus wide. I'm having troubles getting it to pull our software serial
numbers. It keeps throwing a Exception when it gets to that point.
Below is the code I am using. If someone could give me a few ideas. The
app is in Console form now to be translated to a Windows App at a
future date.
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
queryCollection1 = query1.Get();
foreach (ManagementObject mo in queryCollection1)
{
Console.WriteLine("Product : " +
mo["Name"].ToString());
Console.WriteLine("Serial : " +
mo["ProductID"].ToString());
}
Thanks-
Evan Sparkman
There is no such property as ["ProductID"] in Win32_Product, please refer to
the WMI docs for property details.
Willy.
"esparkman" <ev***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
| Hey guys I am working on a application, that will pull our inventory
| campus wide. I'm having troubles getting it to pull our software serial
| numbers. It keeps throwing a Exception when it gets to that point.
| Below is the code I am using. If someone could give me a few ideas. The
| app is in Console form now to be translated to a Windows App at a
| future date.
|
| query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
| queryCollection1 = query1.Get();
| foreach (ManagementObject mo in queryCollection1)
| {
| Console.WriteLine("Product : " +
| mo["Name"].ToString());
| Console.WriteLine("Serial : " +
| mo["ProductID"].ToString());
| }
|
| Thanks-
| Evan Sparkman
|
Willy,
This is under the WMI Class Win32_Product:
ProductID
Data type: string
Access type: Read-only
The product ID.
Windows Server 2003, Windows XP, and Windows 2000: This property is
not available.
Either way could you point me in the direction to retrieve the CD-KEY?
We are a College Campus located in KY, I am writing this so that it
will give us freedom and control of the assest management we use. As
well as give us a some form of inventory control.
Willy Denoyette [MVP] wrote:
There is no such property as ["ProductID"] in Win32_Product, please refer to
the WMI docs for property details.
Willy.
"esparkman" <ev***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
| Hey guys I am working on a application, that will pull our inventory
| campus wide. I'm having troubles getting it to pull our software serial
| numbers. It keeps throwing a Exception when it gets to that point.
| Below is the code I am using. If someone could give me a few ideas. The
| app is in Console form now to be translated to a Windows App at a
| future date.
|
| query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
| queryCollection1 = query1.Get();
| foreach (ManagementObject mo in queryCollection1)
| {
| Console.WriteLine("Product : " +
| mo["Name"].ToString());
| Console.WriteLine("Serial : " +
| mo["ProductID"].ToString());
| }
|
| Thanks-
| Evan Sparkman
|
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\ProductId
No guarantee that it will be in the same place in future versions though.
"esparkman" <ev***********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
Willy,
This is under the WMI Class Win32_Product:
ProductID
Data type: string
Access type: Read-only
The product ID.
Windows Server 2003, Windows XP, and Windows 2000: This property is
not available.
Either way could you point me in the direction to retrieve the CD-KEY?
We are a College Campus located in KY, I am writing this so that it
will give us freedom and control of the assest management we use. As
well as give us a some form of inventory control.
Willy Denoyette [MVP] wrote:
>There is no such property as ["ProductID"] in Win32_Product, please refer to the WMI docs for property details.
Willy.
"esparkman" <ev***********@gmail.comwrote in message news:11*********************@i42g2000cwa.googlegr oups.com... | Hey guys I am working on a application, that will pull our inventory | campus wide. I'm having troubles getting it to pull our software serial | numbers. It keeps throwing a Exception when it gets to that point. | Below is the code I am using. If someone could give me a few ideas. The | app is in Console form now to be translated to a Windows App at a | future date. | | query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product"); | queryCollection1 = query1.Get(); | foreach (ManagementObject mo in queryCollection1) | { | Console.WriteLine("Product : " + | mo["Name"].ToString()); | Console.WriteLine("Serial : " + | mo["ProductID"].ToString()); | } | | Thanks- | Evan Sparkman |
Not sure what documentation you are refering to, but this property is not in
Win32_product and not in the recent MSDN docs.
also:
| Windows Server 2003, Windows XP, and Windows 2000: This property is
| not available.
is a bit indicative for what I'm saying, provided that NT4 is no longer
supported and W9X isn't even a WMI platform.
Willy.
"esparkman" <ev***********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
| Willy,
|
| This is under the WMI Class Win32_Product:
|
| ProductID
| Data type: string
| Access type: Read-only
|
| The product ID.
|
| Windows Server 2003, Windows XP, and Windows 2000: This property is
| not available.
|
|
|
| Either way could you point me in the direction to retrieve the CD-KEY?
| We are a College Campus located in KY, I am writing this so that it
| will give us freedom and control of the assest management we use. As
| well as give us a some form of inventory control.
|
|
| Willy Denoyette [MVP] wrote:
| There is no such property as ["ProductID"] in Win32_Product, please
refer to
| the WMI docs for property details.
| >
| Willy.
| >
| "esparkman" <ev***********@gmail.comwrote in message
| news:11*********************@i42g2000cwa.googlegro ups.com...
| | Hey guys I am working on a application, that will pull our inventory
| | campus wide. I'm having troubles getting it to pull our software
serial
| | numbers. It keeps throwing a Exception when it gets to that point.
| | Below is the code I am using. If someone could give me a few ideas.
The
| | app is in Console form now to be translated to a Windows App at a
| | future date.
| |
| | query1 = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
| | queryCollection1 = query1.Get();
| | foreach (ManagementObject mo in queryCollection1)
| | {
| | Console.WriteLine("Product : " +
| | mo["Name"].ToString());
| | Console.WriteLine("Serial : " +
| | mo["ProductID"].ToString());
| | }
| |
| | Thanks-
| | Evan Sparkman
| |
| This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: James |
last post by:
Hi,
I'm trying to obtain information from a 3rd party software, using ASP .NET.
The software only comes with a Java API that I can use or a telnet
interface. Through telnet, I had to parse the...
|
by: Jeff |
last post by:
Hey gang.
i have a code that i will list. when varM = 8 or 16, the script works fine,
and pulls the top 8 or top 16, but if it =32 or 64, it is only pulling the
top 17 records from the DB.
db is...
|
by: Swroteb |
last post by:
Hi there,
I've got a reasonably sized list of objects that I'd like to pull out
all combinations of five elements from. Right now I have a way to do
this that's quite slow, but manageable. I...
|
by: akelly_image |
last post by:
Okay, if anyone could toss me some idea's here, please bare with my
noobish questions, I just picked up VB2005 Pro about a week ago. ( no
prior VB at all )
Here's my issue..
I'm pulling...
|
by: Joe Spears |
last post by:
Hi
Does anyone have any sample code on Pulling user data from Active
Directory??
Thanks
|
by: relisoft |
last post by:
SEATTLE, Washington. - July 12, 2006: Reliable Software® announces
the upcoming release of Code Co-op® version 5.0. Code Co-op is an
affordable peer-to-peer version control system for distributed...
|
by: piscogirl |
last post by:
Hi there,
I am about to build a small db in Access. Among the tables I plan to
have are a Person table, an Event table, and an EventRegistration
table.
The EventRegistration table will...
|
by: Stewart |
last post by:
Hi there,
I have an Access database, which contains the details of company staff
and services. The plan is to extract data from this database onto our
forthcoming Intranet (no inserting,...
|
by: colleen1980 |
last post by:
Hi: When i run the same code with minor changes in VB it works fine
but when i run in ASP it runs but it not pulling any information from
the web site. Needs help
Thanks,
Anna.
ASP CODE
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |