.net-2.0

Phone number normalization: Any pre-existing libraries?

狂风中的少年 提交于 2019-12-31 18:54:11
问题 I have a system which is using phone numbers as unique identifiers. For this reason, I want to format all phone numbers as they come in using a normalized format. Because I have no control over my source data, I need to parse out these numbers myself and format them before adding them to my DB. I'm about to write a parser that can read phone numbers in and output a normalized phone format, but before I do I was wondering if anyone knew of any pre-existing libraries I could use to format phone

Phone number normalization: Any pre-existing libraries?

家住魔仙堡 提交于 2019-12-31 18:54:06
问题 I have a system which is using phone numbers as unique identifiers. For this reason, I want to format all phone numbers as they come in using a normalized format. Because I have no control over my source data, I need to parse out these numbers myself and format them before adding them to my DB. I'm about to write a parser that can read phone numbers in and output a normalized phone format, but before I do I was wondering if anyone knew of any pre-existing libraries I could use to format phone

C#: Getting maximum and minimum values of arbitrary properties of all items in a list

人盡茶涼 提交于 2019-12-31 10:36:12
问题 I have a specialized list that holds items of type IThing : public class ThingList : IList<IThing> {...} public interface IThing { Decimal Weight { get; set; } Decimal Velocity { get; set; } Decimal Distance { get; set; } Decimal Age { get; set; } Decimal AnotherValue { get; set; } [...even more properties and methods...] } Sometimes I need to know the maximum or minimum of a certain property of all the things in the list. Because of "Tell don't ask" we let the List figure it out: public

Getting the program version of an executable file like explorer does in C# .NET 2 [duplicate]

五迷三道 提交于 2019-12-31 05:15:13
问题 This question already has an answer here : FileVersionInfo doesn't match Details tab in Explorer (1 answer) Closed last year . if I make a right-click in explorer on an executable file and choose "properties". then in the properties dialog I select the tab "version". Then I click on the productversion. This is the value which I need to get with c#. I tried it with "fileversioninfo.productversion", but if I get in the explorer "1.85" the fileversioninfo returns me weird values like: 1,00000,8

Why is the XmlDocument Validate event handler not getting hit?

孤街醉人 提交于 2019-12-31 03:31:10
问题 I have this code: // Load the document XmlDocument xmlDocument = new XmlDocument(); // use the stream and have it close when it is finished using ( argInputStream ) { xmlDocument.Load( argInputStream ); xmlDocument.Schemas.Add( XmlSchema.Read( argSchemaStream, null ) ); xmlDocument.Validate( ValidationEventHandler ); } // this is not getting hit void ValidationEventHandler( object sender, ValidationEventArgs e ) { switch ( e.Severity ) { case XmlSeverityType.Error: Console.WriteLine( "Error:

Capture function keys F1..F12 in VB.NET [closed]

佐手、 提交于 2019-12-30 10:07:10
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I cannot capture the function keys F1 .. F12 for my application. I am able to capture regular keys and modifiers such as shift , ctrl , alt , etc.. This

C# 3.0 compatibility on .Net 2.0

心不动则不痛 提交于 2019-12-30 09:53:19
问题 What are the C# 3.0 language features we can use in an application that targets .Net 2.0 framework ? PS:I know few like Lambda expressions and var keyword 回答1: Please see here: Using C# 3.0 (.Net 3.5) syntax in a .Net 2.0 application For a complete run down of what you can and can't do when targeting the .NET 2.0 Framework and using C# 3.0. In summary: You can't use the new 3.5 assemblies (System.Data.Linq, System.Xml.Linq, System.Core). You can't use Linq/Query Extensions or Extension

How do I concatenate 2 resource strings together in an aspx page

天大地大妈咪最大 提交于 2019-12-30 06:03:06
问题 I have a localised ASP.net application (.net 2.0). I wish to concatenate 2 strings retrieved from the resource file together into one element, something like this. Text="<%$ Resources:Resource, lw_name %>" + <%$ Resources:Resource, lw_required %>" I have tried using Eval without success. Is what I am trying to do the "correct" approach or can I store strings with placeholders in the resource file and interpolate them "on the fly". I am trying to do this in the aspx file rather than in code

When executing an application on .net 4.0, compiled under .net 2.0

大憨熊 提交于 2019-12-29 03:06:06
问题 Assuming that: The C# source code below is compiled under .NET 2.0 (CLR 2.0); and The above application uses the app.config listed below; and Only .NET 4.0 (CLR 4.0) is installed on the environment of the client executing the application, then which version of .NET is internally loaded to execute the application on the client's environment? Description The console application below will simply show that its CLR version is v4.0.30319 in the console, but @Reed Copsey's answer of the stack (CLR

Starting a windows service fails with error 1053

本秂侑毒 提交于 2019-12-28 17:31:45
问题 I have a windows service that is failing to start, giving an error "Error 1053: The service did not respond to the start or control request in a timely fashion". Running the service in my debugger works fine, and if I double click on the the service .exe on the remote machine a console window pops up and continues to run without problem - I can even see log messages showing me that the program is processing everything the way it should be. The service had been running fine previously, though