|
Not sure what you mean, can you try explaining that again?
|
|
|
|
|
Hi,
I am working on a desktop application using VB.NET. On a form, ihave data tobe entered....I have done all the other validations for e.g. numeric and decimal validations.
I want to validate the textbox in which email address is entered.... can any1 suggest me any link to the email address validation code?
Since it is a windows application,i cant use javascript for it.
Thanks
Riz
|
|
|
|
|
javascript has regex, so does .NET. Just use a regular expression.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Sir,
if u please send some code to validate the email address in the textbox (Window appliction).
Thanks and Regards
Pankaj
|
|
|
|
|
hi that is the code in JS switch case in acse of more validating fields u can add here check that if any prob kindly notify
var mEmailAddress = '';
cInvalidEmailAddress = "Invalid email address in "
cInvalidEmailAddress = "Invalid email address in "
switch(cType)
{
case 'email' :
var cVal;
cVal=checkRequired(obj);
if(cVal!=1 && cVal!=2)
{
mReqdFields = mReqdFields + cVal + '\n';
}
else if(cVal==2)
{
if(!validateEmail(obj))
mEmailAddress = mEmailAddress + obj.caption + '\n';
}
break;
}
if (mEmailAddress != '')
ErrStr = ErrStr + cInvalidEmailAddress + mEmailAddress + '\n';
SP
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
Hi,
I dont want to use javascript coz it is not a web application. Since it is a windows application i want to find a code which will validate the characters entered using ASCII codes.
Waiting for ur reply.
Thanks
Riz
|
|
|
|
|
This should do it
Function IsValidEmail(strIn As String) As Boolean
' Return true if strIn is in valid e-mail format.
Return Regex.IsMatch(strIn, "^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
End Function
God bless msdn...
|
|
|
|
|
thanks a lot for ur solution
|
|
|
|
|
@kulazfuk
thanks that helped me too..
|
|
|
|
|
Hi,
If have this solution in VB.NET.
So it wil be helpfull for you.
Regards
Public Shared Function ValidEmailAddress(ByVal emailAddress As String, ByRef errorMessage As String, ByVal Textbox As System.Windows.Forms.TextBox) As Boolean
' Confirm there is text in the control.
If Textbox.Text.Length = 0 Then
Return True
else
errorMessage = "E-mail address is required."
Return False
End If
' Confirm that there is an "@" and a "." in the e-mail address, and in the correct order.
If emailAddress.IndexOf("@") > -1 Then
If (emailAddress.IndexOf(".", emailAddress.IndexOf("@")) > emailAddress.IndexOf("@")) Then
errorMessage = ""
Return True
End If
End If
errorMessage = "E-mail address must be valid e-mail address format." + ControlChars.Cr + _
"For example 'someone@example.com' "
Return False
End Function
Hi,
If have this solution in VB.NET.
So it wil be helpfull for you.
Regards
H.w. Hendrick, Netherlands
|
|
|
|
|
hi all,
how can we c the line number in our code window?
Thnaks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
dear its so easy.........line no. is displayed on status bar (Down on window)of our code window
as Ln .
for e.g. Ln 19 col 9
it means our cursor is on line 19 & col 9
is it ok or ur question was differnt?
priya
|
|
|
|
|
If you're using .NET, then, yes. Just go into the Tools/Options/Text Editor, choose VB, and check the box.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Sir,
Can I programically find , In which line number presently I am.(using vb.net 2005)
Thanks and regards
pankaj
|
|
|
|
|
I doubt it
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
sir,
U mean , i can't calculate the linenumber in the textbox (multiline option or richeditcontrol )
Thnaks and Regards
pankaj
|
|
|
|
|
You know, you ask a different question every time. Yes, of course you can work out a line number from a textbox. Just count the number of newlines.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
sorry sir, I did not mean that . I wanted to know , the line number , On which the cursor presently is, into the textbox , programically.
Thanks and regards
Pankaj
|
|
|
|
|
Hi,
you can take a look here for a start:
http://www.codeproject.com/cs/samples/linenumberingapp.asp[^]
There are also heaps of hits on google which let you use GetCurPos() and GetCursorPos() to get the position of the caret if you wish to return the line you are currently editing. I'm sure there are some built in things in the framework, though I'm really tired and can't think at the moment.
Cheers,
Daniel
|
|
|
|
|
goodMorning Frendz,
I have one column of datagridview as "date"....so i wnt to ask-> "Is there a columntype of datagridview like "DatagridviewDateTimepicker" like "DataGridViewComboBoxColumn"....if i wnt take datetimepicker on datagridview's each row on specified column wht should i do?
Help me Plizz.
Regards priya
|
|
|
|
|
|
Mam ,
Is this link useful?
Regards
Pankaj
|
|
|
|
|
Thank u so much pankaj....thts nice site.
regards priya
priya
|
|
|
|
|
Hi everyboy. I want to encrypt content in text file and decrypt it to normal text file. please show me the code that do it. thank beforehand.
|
|
|
|
|