|
still no answer
any one ??....
|
|
|
|
|
Hi,
you failed to sufficiently explain the problem:
- how is the LED connected to the PC? is it attached to a microcontroller of some kind?
if so, which one, what is the command set of the interface?
if not, I must assume it is connected straight to one of the RS232C control pins, so which one, and why would you need to send data bytes then? 5 bytes sent at an unknown baud rate take a few milliseconds at most, so if the LED is connected to the RS232C TxD pin, it gets energy for that long, and the human eye will not notice it al all.
- you did include a series resistor I hope, otherwise the LED has been killed already.
- how does this relate to C#?
|
|
|
|
|
Can/would somebody tell me how to display an icon on a form in C# please (Windows CE 5.0)? I have to display the battery level of a remote sensor on a form. I created several icons, with VS, and depending on its battery level I will pick the corresponding icon file. I'm new to C# and Windows CE 5.0 and I'm sure it’s easy to do but I'm not having any luck with the searches.
Thanks,
Bob
|
|
|
|
|
|
Which wire did you cut at last?
Life is 5: 3 me, 1 you.
|
|
|
|
|
hi to all.
i have a html file that contains a "select" control (dropdown) with a few "option"s i need to read the option and the value of each of them,
is it possible to load a html code into a HtmlDocument and then read the control by getElemementByName?
Or does any one have the regex pattern to read the options and values of a dropdown control?
Thanks
|
|
|
|
|
Eli Nurman wrote: is it possible to load a html code into a HtmlDocument and then read the control by getElemementByName?
Yes. However if it is XHTML it would be simpler to use an XML Parser
led mike
|
|
|
|
|
how is that possible to to?
|
|
|
|
|
Eli Nurman wrote: how is that possible to to?
Not sure what they call it on the planet you come from, but round here we call it programming.
led mike
|
|
|
|
|
Try Html Agility Pack:
http://www.codeplex.com/htmlagilitypack[^]
For a one-off it may be overkill, but if you're going to be doing alot of html parsing it can be incredibly useful to use xpath on html.
|
|
|
|
|
after getting the inner html of the control how do i process it? i need a regex pattern
|
|
|
|
|
Eli Nurman wrote: after getting the inner html of the control how do i process it? i need a regex pattern
Have you ever used xpath before? With xpath, you can do something like
htmlDoc.SelectNodes("//yoursubdiv/your_option_box/select");
And you will get a collection of nodes back whose values are the text of the selections. No need for regex, no need for html parsing.
This is the best suggestion I can make. Otherwise you'll need to spend some time studying regex and figuring out the exact pattern required to pick out the right dropdown, etc. It can be an irritating and mind-numbing process.
If your document is guaranteed to be XHTML valid, you can even use Xml navigators straight out of the .NET framework with no need to use the Html Agility Pack (HAP is designed to provide XPATH functionality to html documents, which are not strict xml and so will not validate in the XmlDocument constructor).
|
|
|
|
|
Please don’t confuse here is my exact problem.
1)I have an class say A. which has few properties say
a. Int I;
b. String str;
c. Object[] B ;
2) now I am have an object of class A
3) Now I am using reflection on A
Like
Foreach(PropertyInfo Aproperty in A.GetProperties )
{if (Aproperty.PropertyType.IsArray)
{
Type t = Aproperty.PropertyType.GetElementType();
PropertyInfo[] Bproperty = t.GetProperties(); //For fetching the properties are that are present in object B
foreach(PropertyInfo p1 in Bproperty)
var x = p1.getvalue(?,null) //getbvalue takes the object whose property you are fetching but I am stuck up here not able to fetch this object.
}
so the problem i am facing is i am not able to fetch the object of B(?),so it would me really great if someone can provide an answer to this.
|
|
|
|
|
Hello All
I have a group of applications that working on a LAN and there was another application -reporting tool- that may use the databases of all other applications through web services -each application provide a web service to give access to its database-, and this is working good, the problem is that I had to make a new build for the reporting tool each time a new application added to the group, this is absolutely not happening every day, but I was think in an optimized solution, which I think is to make the reporting tool call the IIS in every machine on the network to get the web services that is available, and then provide the admin by a list of the web services then prompt him to add reference to the web services that he wish to connect with, this means that I should add web references at the runtime.
I don’t know if I can call the IIS to do that, or if I can add web references at runtime, but I thought on the problem as a logic which I don’t know if it can be done or not.
my question is, is this can be done?, and how to do it?
|
|
|
|
|
If the methods you use in the reporting tool, are the same in each of the web services, you can create your own (single) proxy.
The easiest way is to use WSDL tool and possibly strip off everything you don't need from the generated file. Now you can better control the change of the URL and also other properties of the proxy. Also when you add the generated class to you code, you don't need to add web references anymore.
Hope this helps you,
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
sorry i can't understand this, please give me a link for an example or article
|
|
|
|
|
|
Evening all !
Can anyone tell how i declare a list in my class so all the methods can see/access it or is this not possible ?
I've created a list in button code in a form -
List<Animal> zooAnimals = new List<Animal>();
but can't seem to figure out how to make it global so other methods can access it.
I tried
public List <zooAnimals>;
but that doesn't work
Thanks in advance
|
|
|
|
|
use the word static before the declaration. But then the list will belong to the class and not the object
|
|
|
|
|
Declare a class (public, static if you want) and define the list in that class. For example:
public static class MyList {
private static readonly List <zooAnimals> = new List<Animal>();;
public static List<Animal> ZooAnimals {
get {
return zooAnimals ;
}
}
}
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
readonly is not recommended for objects of this sort since it implies the objects of the list are unchangeable when in fact they are. It is a constantly source of errors for novices.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
When posting the answer I though for awhile if I should declare the list readonly or not.
When used correctly, readonly eliminates certain problems that can occur if the actual list is changed. I would say that it depends if you want the list to be changed or just to allow to modify it's content. That's why I also defined only getter for the property.
The other thing was that the original question was, how to define a list globally so that others can see and use it. Based on the question my interpretation was (maybe incorrectly) that the list should not be changeable, but it's contents can still be modified.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Whats the difference between
if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
{
}
and
if(e.Button == MouseButtons.Right)
They both work the same
I am unable to understand the use of the logical operator &
and ALSO when I change the & with && it wont work
Can anyone help
|
|
|
|
|
humayunlalzad wrote: Can anyone help
Yes, you can by learning what bits are and how the different bit operations work. Perhaps you should start here[^]
led mike
|
|
|
|
|
They don't actually work the same. If that event was raised with both right and left mouse buttons pressed (eg: e.Button = (MouseButtons.Right | MouseButtons.Left)) then the two snippets would be different. The difference is that the first one checks to see if a particular bit in a value is set and the second checks to see if the value is exactly equal to some other value.
I assume that when you switch & with && you got a compiler error. The single operators & and | are used to perform bitwise operations. The double operators && and || are used to perform operations on boolean values.
|
|
|
|