Mega Code Archive

 
Categories / Delphi / Examples
 

Mail adresinin doğruluğunun kontrol edilmesi

//bu kod delphiturk tdi lerinde wardı güsel bir kod bende ekledim Function IsValidEMail(e:string):boolean; function count(s,sub:string):byte; begin result:=0; while(pos(sub,s)<>0) do begin delete(s,pos(sub,s),1); inc(result); end; end; var i,k:byte; begin result:=false; if ((count(e,'@')>1) or (count(e,'@')=0)) or (count(e,'.')>1) then exit; i:=pos('@',e); k:=pos('.',e); if (i<k) and (i<>1) then begin delete(e,1,pos('@',e)); if pos('.',e)>1 then result:=true; end; end; //kullanımı isvalidemail(edit1.text);