The following regular expression will validate phone numbers in all well known formats, such as: 555-12-34555 12 34555 1234555 12-345551234(012) 555-12-34(012) 555 1234+1 (012) 555-12-34+1 (012) 5551234 …and many other similar formats. /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/
At compile I get error CS0138: A using namespace directive can only be applied to namespaces
You are trying to designate a class instead of a namespace for the using statement.For example: using System.Console; This is not correct because the using statement only works with namespaces, while Console is a class.
WhoIs function for domain-name info
This function returns the WhoIs string for the passed domain name (such as the domain-name owner and nameservers) by opening a socket to a WhoIs server.
Can I use MySQL with C#?
Yes, you can use MySQL with C#.You can connect to the database by using ODBC driver and the System.Data.Odbc namespace. Search with Google for tutorials on how to connect to the database as there are some on the web.Here is one:http://www.devhood.com/tutorials
How to swap two numbers without using a third variable
Using pointers you can easily swap two variables without using an additional variable to store a temporary value. This is because instead of swapping values, you can swap addresses, as shown in this function: void SwapSmart(int * a, int * b){*a = *a xor *b;*b = *b xor *a;*a = *a xor *b;}
How do I stop the form from closing / How do I prompt the user to confirm the closing of the application when he presses the X button?
There are a few reasons why you may want this, in some applications, for example, you may want to ask the user if he wants to save the work before closing. You can easily do this by handling the form’s Closing event.In the following example we stop a form named Form1 from closing when clicking the ‘X’ shaped button: […]
How do I change the timeout limit for my PHP code?
If you would like to overwrite the script execution timeout limit defined in php.ini, you can do that directly from your PHP code using the following line: // Set it to no-limitset_time_limit(0); Of course you can as well set it to any time limit in seconds. The default time limit is 30 seconds.
Backup mysql data using PHP in Windows
How to backup mysql data using PHP in Windows XP, 2000, NT
Drop-down list of US states
A complete list of the 50 US states alphabetically ordered, that can be used in any HTML page. The value for each state is the two letter abbreviation.
Convert Color Images to Gray Images
The algorithm that can convert a color image to a gray image.