473,378 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Can't get OEMStringArray

Trying to get OEMStringArray from WMI and use it as Text, but result is still empty textbox. Looks like ouput is string[].
command like "wmic computersystem get oemstringarray" works
Sorry, I'm newbie programmer.

Tried:

Expand|Select|Wrap|Line Numbers
  1.       ManagementObjectSearcher mc7 = new ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem");
  2.       ManagementObjectCollection moc7 = mc7.Get();
  3.       if (moc7.Count != 0)
  4.          {
  5.              foreach (ManagementBaseObject mo7 in moc7)
  6.                 {
  7.                 textBox7.Text = mo7["OEMStringArray"].ToString();
  8.  
  9.                 }
  10.           } 

And also:

Expand|Select|Wrap|Line Numbers
  1.             ManagementClass mc3 = new ManagementClass("Win32_ComputerSystem");
  2.             ManagementObjectCollection moc3 = mc3.GetInstances();
  3.             if (moc3.Count != 0)
  4.             {
  5.                 foreach (ManagementObject mo3 in mc3.GetInstances())
  6.                 {
  7.  
  8.                     textBox7.Text = mo3["OEMStringArray"].ToString();
  9.  
  10.                  }
  11.              }   
  12.  
Some of this:
Expand|Select|Wrap|Line Numbers
  1.                     ...
  2.                     string[] stringArray = mo5["OEMStringArray"] as String[];
  3.                     foreach (string myString in stringArray)
  4.                     {
  5.                     listBox2.Items.Add(stringArray);
  6.                     }
  7.  
Any ideas ?
Dec 8 '10 #1
0 1320

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Aaron Brockhurst | last post by:
Hi Can anyone help? I cant get my php script to insert or delete records into a mysql table. I can view them all fine but that's about it. I've checked the user permissions on mysql and...
4
by: gregsands | last post by:
Hi I have read all (ok most) of the posts relating to "Call to undefined function mysql_connect()", read the manual on PHP.net and done eveything thats ive been asked to do but cant get PHP to...
0
by: Tillmann Neben | last post by:
As the topic already says, i just cant get it working. I am using "ftp-mode" to get the files onto the server instead of using frontpage extension. When I try to debug, VS tells me, that the...
16
by: Mike Fellows | last post by:
when i load my windows form i populate a combobox i use the code below Dim conn As New System.Data.SqlClient.SqlConnection(strConn) Dim sql As String = "AllLenders" Dim da As New...
2
by: g35rider | last post by:
Hi, I have the following code that is giving this error, I cant simplify the code, I was just testing some theory for something we are doing and was getting an issue here. Please someone point out...
3
by: arun.hallan | last post by:
Hi, I'm having problems with authentication. I have a set of users that are allowed to use a webpage. They are in domain A. My goal is to get the username of these users and then check them...
2
by: andrewanderson | last post by:
hi can anyone help me with this prog. cant find the prob why it cant display cout<<"This is the display of your transaction"<<endl; ifstream fobj; //declare input file stream ...
1
by: Nagaraj | last post by:
hi all, I have simple basic c++ program "hello world" which i cant compile on linux system. I have given extension as .C. please tell me how to compile C++ programs on Linux.
6
by: WolfgangS | last post by:
Ok first off, i am a total beginner at this groups stuff and i have no clue how this works. This is probabaly the wrong group for my problem but i will post it anyways. Learning by doing right? ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.