|
Manufacturers are not expected to provide WMI data providers for everything they make. You' not getting any results because either you did not install the WMI providers supplied with your motherboard or they simply don't exist. If they don't exist, you can't use WMI to get the CPU temp.
|
|
|
|
|
AH O.K,
So Waht i need is to find if my M.B Supports WMI Data and have the Driver
THANKS
Have Fun
Never forget it
|
|
|
|
|
Da how can I see the details of an assembly ( dll or exe)
I tried in notepad…
Do we have any method to list out the methods declared in the assembly?
My small attempt...
|
|
|
|
|
use the Lutz Roeder .net reflector or add the assembly to project visual studio or/and use object browser to explore its contents or
....
f(yf) = yf
|
|
|
|
|
Hi All,
I have some foreach loops like this:
foreach(Datarow Head in mydt.Rows)<br />
{<br />
foreach(Datarow Sub1 in mydt1.Rows)<br />
{<br />
}<br />
<br />
foreach(Datarow Sub2 in mydt2.Rows)<br />
{<br />
}<br />
}
Now what should i use that when my condition within foreach(Datarow Sub2 in mydt2.Rows) is true , my programe most go back and continue the begin foreach: foreach(Datarow Head in mydt.Rows)
Thanx.
|
|
|
|
|
I think the word you are looking for is
break;
Just do this:
if(someCondition.IsMet)
{
break;
}
Simon
|
|
|
|
|
use exit , continue , break .improvise. and never modify the collection while you are in the loop
f(yf) = yf
|
|
|
|
|
i tested continue, return, break. None of those gives me the right output
|
|
|
|
|
As Simon said break; should do it.
if you are in a loop and you have hit your required condition "break" will exit the current loop. (or better re-design\refactor your code so you dont have so many loops)
modified on Wednesday, April 2, 2008 10:58 AM
|
|
|
|
|
Try the following example based on the code structure you gave:
int[] mydt = new int[] { 2, 0, 1 };
object[] mydt1 = new object[] { new string[] { "Aa", "Ab", "Ac" }, new string[] { "Ba", "Bb", "Bc" }, new string[] { "Ca", "Cb", "Cc" } };
object[] mydt2 = new object[] { new string[] { "Aa", "Ax", "Ac" }, new string[] { "Ba", "Bb", "Bx" }, new string[] { "Cx", "Cb", "Cc" } };
foreach ( int Head in mydt )
{
Console.WriteLine("Head = {0}", Head);
string[] mydt1Rows = (string[])mydt1[Head];
foreach ( string Sub1 in mydt1Rows )
{
Console.WriteLine(" Sub1 = {0}", Sub1);
}
string[] mydt2Rows = (string[])mydt2[Head];
foreach ( string Sub2 in mydt2Rows )
{
Console.WriteLine(" Sub2 = {0}", Sub2);
if ( Sub2.IndexOf("x") != -1 )
{
Console.WriteLine(" break: in order to skip to next Head");
break;
}
}
}
It should give you
Head = 2
Sub1 = Ca
Sub1 = Cb
Sub1 = Cc
Sub2 = Cx
break: in order to skip to next Head
Head = 0
Sub1 = Aa
Sub1 = Ab
Sub1 = Ac
Sub2 = Aa
Sub2 = Ax
break: in order to skip to next Head
Head = 1
Sub1 = Ba
Sub1 = Bb
Sub1 = Bc
Sub2 = Ba
Sub2 = Bb
Sub2 = Bx
break: in order to skip to next Head
showing that the break is properly ending the inner Sub2 loop when the condition occurs (Sub2 contains 'x').
Clive Pottinger
Victoria, BC
|
|
|
|
|
I am novice to DB operations. I had some question.
In a DB there are 3 tables Company, Customer, Contact.
Company feilds: Cid, CName,
Customer feilds: custID, custName, Cid(same as company), etc......
Contact feilds: conID, conName, custID(same as customer), etc.....
This approach i m using:
1) loading the company table on form_load event, and binding CName to combobox.
2) On combBox Selection_change_commited event loading data from Customer table where Cid is same. After filling the DataTable calling the BindCust method to bind data.
===Here i m facing a problem, when 1 selects the name from cmbBox, the corresponding feilds of Customers table loads only for 1st tym. If i select name 2nd tym the data remain unchange. what is wrong?
I also use cmbBox selection_change event, in this data is not loading at all.
3) then i create a currency manager of Customer datatable, on the cm_Position_change event i am loading contact table and after that calling BindContact method.
Plz, guide me.
a) Is this approach is Ok?
b) If not. then plz tell/guide me, how to acheive the same.
I want
If user selects a Name from cmbBox, then all customers that name appears,
then against this customer all contacts details appears.
Thanks to all.
|
|
|
|
|
Is there no standard tree structure supplied with .Net? If not, any recommendations on a third party one?
|
|
|
|
|
Do you mean TreeView, or a hierarchical structure of items? If the hierarchical structure then I have one knocking around somewhere you can have. Let me hunt it out and you can have a copy - I'll probably post it on my blog.
|
|
|
|
|
The "hierarchical structure of items" one
|
|
|
|
|
Is a red-black tree OK with you?
|
|
|
|
|
|
|
|
hi
In my form there is tree view name Account_Tree at the time of adding nodes to the tree view i have done this
Account_Tree.Nodes[0].Nodes.Add("1","Acc");
Now i want to get the Key value
How to do this ?
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
I don't have VS running at the moment....but here are the steps to answer your own question.
Maybe you want to walk through all added nodes so you start building some kind of structure.
foreach ( TreeNode node in Account_Tree.Nodes[0].Nodes )
{
}
Now inside that loop you are going to rip out the value of one of the fields so
inside the foreach loop you would type node.
Now browse the Intellisense and read the various descriptions to find which property returns the data you want.
|
|
|
|
|
thank u ! unfortunately i found nothing in the intelli sense thats why posted the question here
e.node.name gives the key value but it's used under some events i want to get the value where ever i want in the form
please do help me
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
I want a method to return different types/classes depending on an in-parameter. More specifically, this is what I want to do:
public struct MyStruct
{
public string myString;
public byte myByte;
public int myInt;
public MyStruct(
string myString_,
byte myByte_,
int myInt_)
{
myString = myString_;
myByte = myByte_;
myInt = myInt_;
}
}
public enum MyStructMemberSelector
{
MY_STRING = 0,
MY_BYTE,
MY_INT
};
public MyStruct[] myStructArray = new MyStruct[]
{
new MyStruct("String 1", (byte)1, 1),
new MyStruct("String 2", (byte)2, 2)
};
public ? getAllItems(MyStructMemberSelector myStructMemberSelector)
{
return ?;
}
.
.
.
string[] myStringArray = getAllItems(MyStructMemberSelector.MY_STRING);
byte[] myByteArray = getAllItems(MyStructMemberSelector.MY_BYTE);
int[] myIntArray = getAllItems(MyStructMemberSelector.MY_INT);
.
.
.
How should I implement the getAllItems method? I am a beginner C#-programmer so please feel free to be specific and include snippets of code in your reply. Thanks in advance for any help!
|
|
|
|
|
the IF will fit here . google strategy pattern also enlightening . refactor condision with strategy also .
f(yf) = yf
|
|
|
|
|
Well, C# only supports function overloading by parameters not return type (which incidentally is not the case for .NET overall) so you either need to create a different named function for each type which is probably useless for what you're trying to do or make your function return an object .
Everything is an object you see, then you can downcast it to whatever you want later. The as keyword is good for this (with reference types).
Regards,
Rob Philpott.
|
|
|
|
|
Thanks for your suggestions. I have a feeling it can be solved somehow using Generics, but I'm not sure how. Anybody have an idea?
|
|
|
|