Archives for: "November 2008"
Regular Expression Validation
I like to use regular expression validation. That is simple. You only need to use:Codeusing System.Text.RegularExpressions For the numeric value validation: CodeRegex regex = new Regex(@"^[0-9]*$");if… more »
Use tryparse if that is possible or have a validation
I faced a number of error for parsing a string into int. In most of cases, there is a validation missing. CodeIf (IsNumeric(str)){ int i =0; Int32.TryParse(str,out i);} You can use regex inside IsNumber or use foreach loop to… more »
Server Side logic vs Client Side logic
I think Server Side and Client Side, both have advantages and disadvantages. Server Side: Adv: More efficiencyEasy to scale up(if the process is too complex, we can use load balancing) Dis:Hard to deploy, to some complex operations, it may be… more »
String.Format- a comma in each thousand
I have tried to Convert.ToString to convert int into a format a comma in each thousand. I am not successfully. Well, because I went to a wrong way. I shoulduse String.Format. Just like this Display the int in thousand format(e.g. 1,200)… more »
Network Tester
This afternoon, I was practicing Socket Programming in C#. That is the reason I wrote this program. http://www.itblogs.info/download/NetworkTester.zip This program can check whether the port of IP address is opened. Note that, that is only a toy to… more »
How to open a url from winform LinkLabel.
That is easy! In Click of LinkLabel: System.Diagnostics.Process.Start("http://www.itblogs.info/"); Then .Net Runtime will call your default browser. more »