Click here to Skip to main content
15,899,126 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
Luc Pattyn5-Apr-08 10:00
sitebuilderLuc Pattyn5-Apr-08 10:00 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
sgeorgije5-Apr-08 11:05
sgeorgije5-Apr-08 11:05 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
Luc Pattyn5-Apr-08 11:20
sitebuilderLuc Pattyn5-Apr-08 11:20 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
sgeorgije5-Apr-08 12:08
sgeorgije5-Apr-08 12:08 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
Luc Pattyn5-Apr-08 13:11
sitebuilderLuc Pattyn5-Apr-08 13:11 
GeneralRe: Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created Pin
Member 54067796-Aug-08 2:35
Member 54067796-Aug-08 2:35 
GeneralToolbox control like in VS Pin
Gareth H5-Apr-08 7:50
Gareth H5-Apr-08 7:50 
GeneralC# and Win32_PhysicalMedia SerialNumber from HDD Pin
novadon5-Apr-08 7:02
novadon5-Apr-08 7:02 
Hey Guys, Gals.

The following function I am quite stuck on... and hope you are able to help or provide some form of direction.

Basically I have been able to gather "logical drive details" about connected storage, however, with regards to the Serial Number, all I can acquire is the Volume Number, which is not unique to the physical hard drive itself.

I realise that in order to acquire the manufactures serial number I need to utilise the Win32_PhysicalMedia Class, (link below), however I haven't got the foggiest with whats going wrong

Does anyone have any ideas, code example that actually works?

I am using Vista or XP Professional, Visual Studio 2008.

This is what I have so far....

ManagementObjectSearcher Serial = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")

foreach (ManagementObject Serials in Serial.Get()

{ combo_box.Items.Add(Serials["SerialNumber"].ToString()); }

Furthermore, the error I get is: NullReferenceException was unhandled, object reference not set to an instance of an object? Use the "new keywords" to create an object instance?

Cheers

Ian.

http://msdn2.microsoft.com/en-us/library/aa394346.aspx">http://www.eggheadcafe.com/forumtree.aspx?topicid=2
GeneralRe: C# and Win32_PhysicalMedia SerialNumber from HDD Pin
Luc Pattyn5-Apr-08 7:42
sitebuilderLuc Pattyn5-Apr-08 7:42 
Generalreading Windows settings (dcom) Pin
Schimaera5-Apr-08 6:33
Schimaera5-Apr-08 6:33 
QuestionHow to test connectivity to a UDP port on a remote system Pin
darthBug5-Apr-08 6:28
darthBug5-Apr-08 6:28 
GeneralRe: How to test connectivity to a UDP port on a remote system Pin
mav.northwind5-Apr-08 8:07
mav.northwind5-Apr-08 8:07 
GeneralRe: How to test connectivity to a UDP port on a remote system Pin
darthBug5-Apr-08 8:57
darthBug5-Apr-08 8:57 
General.NET remoting exception Pin
swati245-Apr-08 4:33
swati245-Apr-08 4:33 
GeneralRe: .NET remoting exception Pin
CodingYoshi5-Apr-08 7:31
CodingYoshi5-Apr-08 7:31 
GeneralRe: .NET remoting exception Pin
mav.northwind5-Apr-08 8:12
mav.northwind5-Apr-08 8:12 
QuestionHow to open a form in tableLayoutPanel control while loading? Pin
S a n d y5-Apr-08 2:34
S a n d y5-Apr-08 2:34 
GeneralAdministrate Indexing Server via Web App Pin
Muhammad Nauman Yousuf5-Apr-08 0:56
Muhammad Nauman Yousuf5-Apr-08 0:56 
GeneralBlocking certain website Pin
the pink jedi4-Apr-08 19:57
the pink jedi4-Apr-08 19:57 
GeneralRe: Blocking certain website Pin
Thomas Stockwell5-Apr-08 14:22
professionalThomas Stockwell5-Apr-08 14:22 
Generali need ole total collection and data type Pin
badshah20054-Apr-08 11:57
badshah20054-Apr-08 11:57 
GeneralRe: i need ole total collection and data type Pin
Rick van Woudenberg4-Apr-08 12:12
Rick van Woudenberg4-Apr-08 12:12 
Generalcompare byte array Pin
baranils4-Apr-08 11:37
baranils4-Apr-08 11:37 
GeneralRe: compare byte array Pin
MidwestLimey4-Apr-08 11:55
professionalMidwestLimey4-Apr-08 11:55 
GeneralRe: compare byte array Pin
Rick van Woudenberg4-Apr-08 11:55
Rick van Woudenberg4-Apr-08 11:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.