C++/CLI ManagmentObjectSearcher using

Wami007 296 Reputation points

private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
ManagementObjectSearcher^ searcher = gcnew ManagementObjectSearcher("select*from Win32_BIOS ");
lb1->Text = Convert::ToString(searcher);


I wanna Define Hardware info to my Label, but it shows me " System.Managment.Object.Searcher ". Can Anyone help me for it, with correct sample code :(

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,504 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,328 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,077 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 106.5K Reputation points

    For example, if you want to display the manufacturer and serial number, then:

    ManagementObjectSearcher searcher( "select * from Win32_BIOS" );
    for each( ManagementObject ^ d in searcher.Get( ) )
         lb1->Text = d["Manufacturer"]->ToString( );
         lb2->Text = d["SerialNumber"]->ToString( );

0 additional answers

Sort by: Most helpful