Browsing 7239 questions and answers with Jon Skeet
You can't set the encoding of a text box, but it sounds like you're just trying to display some binary data in a text box... did you want hex, for example? If so, BitConverter.ToString(byte\[\]) is your friend: textBox1.Text =... more 9/16/2014 3:58:36 PM
There are several potential problems here: You're not specifying a format You're not specifying a locale You're not specifying a time zone You're trying to cast the return value (which will be a java.util.Date reference) to a... more 9/16/2014 3:28:25 PM
You can't, basically. There's no way of doing that. Even if you could do it for a simple call to prohibit arguments of different types, it could always be bypassed using a cast: equals((Object) date, (Object) string) If you're... more 9/16/2014 11:11:49 AM
You'll want to use a reverse geocoding API of some kind. For example: The Bing Maps API (the webservice) The Google Geocoding API The Geonames API If you're already using the Bing.Maps SDK, you should use the Map.SearchManager property... more 9/16/2014 10:16:34 AM
This is the sort of thing that my Noda Time project is designed to handle. It has a Period type which does know about months and years, not just a fixed number of ticks. For example: LocalDateTime start = new LocalDateTime(2014, 1, 1, 8,... more 9/16/2014 7:13:53 AM
The point is that the compiler doesn't know that you're calling an overridden method which doesn't throw any checked exceptions. When it sees: a.process(); it doesn't "know" that the value of a is actually a reference to an instance of... more 9/16/2014 6:28:43 AM
You need to use @ in your XPath for an attribute, and also your path specifier for the second element is wrong: String msg = xpath.evaluate("/message/che/@CHID", document); String status = xpath.evaluate("/message/che/pds/position/@PPOS",... more 9/16/2014 5:45:38 AM
I want it to be the "&" not &. Then it would be invalid XML. Why do you want invalid XML? LINQ to XML is expressing the text you've requested in valid XML. That's what it's meant to do. If you ask for the text of the element... more 9/16/2014 5:27:10 AM
Unfortunately the rules for generic conversions in C# don't allow for this directly, but you can go via object. For example: byte[] data = (byte[]) (object) value; However, you might consider whether it's really appropriate for this to... more 9/14/2014 4:39:57 PM
If you know that all your input is going to be in the Basic Multilingual Plane (U+0000 to U+FFFF) then you can just use: char character = 'x'; int codePoint = character; That uses the implicit conversion from char to int, as specified... more 9/13/2014 7:37:55 PM