I am developing a windows application using c#.
The user enters a website name which should allow only 2 dots for eg www.google.com
I have written but that is accepting only 1 dot. The code I have written is :-
- if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
- {
- e.Handled = true;
- }
Thanks in Advance ...!!!