also @ TechSpot: Fair Labor Association begins inspections of Foxconn at Apple's request
Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.

Go Back   TechSpot OpenBoards > Software > Software Apps

Download Now:

check whether the @ exists

Thread Tools Search this Thread
  #1  
Old 03-20-2006
Newcomer, in training
 
Member since: Jun 2005, 7 posts
check whether the @ exists

i am working on a visual basic project and i have the following problem. i use a textbox were users enter their email address. i want to check whether the @ symbol exists in the textbox.
how can this be done?
  #2  
Old 03-20-2006
TechSpot Evangelist
 
Location: has left the building
Member since: Aug 2003, 8,165 posts
ever heard of Google?
Try "visual basic check for valid email"
  #3  
Old 03-22-2006
MrGaribaldi's Avatar
TechSpot Ambassador
 
Location: Babylon 5, Grid Epsilon
Member since: Feb 2002, 2,802 posts
Quote:
Originally Posted by Google
Your search - "visual basic check for valid email" - did not match any documents.
Without knowing (/remembering) anything of VB, the easiest way would be to run through the text string character by character, and check if there is an '@' in there, and that somewhere after it, there is a '.' followed by 2 to 4 characters.
That will be a better way than most programmes does it, as they usually accept "you@re.stupid" or similar adresses.
Of course, it takes more cpu cycles, but still..

Last edited by MrGaribaldi; 03-22-2006 at 12:17 PM..
  #4  
Old 03-22-2006
Mictlantecuhtli's Avatar
TechSpot Special Forces
 
Location: Finland
Member since: Feb 2002, 4,886 posts
System specs
Quote:
Originally Posted by MrGaribaldi
the easiest way would be to run through the text string character by character, and check if there is an '@' in there, and that somewhere after it, there is a ',' followed by 2 to 4 characters.
That will be a better way than most programmes does it, as they usually accept "you@re.stupid" or similar adresses.
I did this recently in one PHP code I had to do. There are a lot of allowed characters in the address before @ and in the domain after it, it's just that too many e-mail applications aren't designed to handle "international" characters.

Furthermore, it's not just two to four characters allowed in domain, and I presume you meant a dot instead of a comma. There can be any number of dots in the domain address, as far as I know (zero could be localhost, for example; two are used in many countries, .co.uk, .co.jp etc.). One simple way would be to check if the domain exists in DNS records.

Besides, top-level domains can have more than four characters, for example http://about.museum is a valid URL.

See also: RFC822: Standard for ARPA Internet Text Messages
  #5  
Old 03-22-2006
MrGaribaldi's Avatar
TechSpot Ambassador
 
Location: Babylon 5, Grid Epsilon
Member since: Feb 2002, 2,802 posts
Ok, I admit it, I'm somewhat tired, and my fingers aren't hitting all the right keys at the right time... Yes, I meant 'dot' not comma.

As for checking for the dot, I didn't mean there should only be one, I only meant you should check that there is a dot at the end followed by up to a certain amount of characters. But I was wrong about the amount of characters there can be in a top leve domain.

What could be done is to retrieve a list of top level domains every now and again and compare against that. Checking for if it is a complete valid domain would take some time, and would increase the complexity of the program by quite a bit. Though it is a good idea.

As for international characters, I know, and I'm pretty pissed off there is so little support. I've got a nice little domain name, but it contains an international character, and since neither IE nor outlook supports that at present, there is no use for it... But in a couple of years, hopefully...
Anyways I digress...
  #6  
Old 03-22-2006
TechSpot Evangelist
 
Location: has left the building
Member since: Aug 2003, 8,165 posts
Quote:
Originally Posted by MrGaribaldi
Your search - "visual basic check for valid email" - did not match any documents.
My Google search results: Results 1 - 10 of about 11,000,000 for visual basic check for valid email. (0.57 seconds)

http://www.freevbcode.com/ShowCode.asp?ID=1754
http://msdn.microsoft.com/library/en...asp?frame=true
http://www.planet-source-code.com/vb...txtCodeId=1316
etc., etc.
  #7  
Old 03-24-2006
Newcomer, in training
 
Member since: Jun 2005, 7 posts
thanks

thanks for the tip guys
Closed Thread

Similar Topics
Topic Replies Forum
Log Check 0 Virus and Malware Removal
Computer skips (problem still exists) 17 Windows OS
After following instructions - problem still exists... 14 Virus and Malware Removal
problems unmapping a network drive that no longer exists 6 Storage and Networking
CooolWebSearch & Home Search Assistent still exists 4 Windows OS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
All times are GMT -4. The time now is 01:20 PM.