function judge(email:string):integer; //0:正确 1:错误
var
ss:string;
cc,dd:integer;
begin
ss:=email;
cc:=0;
dd:=0;
if length(trim(ss))=0 then
begin
result:=1;
exit;
end;
if copy(ss,1,1)='@' then
begin
result:=1;
exit;
end;
if copy(ss,1,1)='.' then
begin
result:=1;
exit;
end;
if pos('@.',ss)>0 then
begin
result:=1;
exit;
end;
if pos('@@',ss)>0 then
begin
result:=1;
exit;
end;
if pos('..',ss)>0 then
begin
result:=1;
exit;
end;
if pos('.@',ss)>0 then
begin
result:=1;
exit;
end;
if pos('@',ss)<=0 then
begin
result:=1;
exit;
end;
if pos('@',ss)>0 then
begin
ss:=copy(ss,pos('@',ss)+1,length(ss));
cc:=1;
end;
if (pos('@',ss)>0)and(cc=1) then
begin
result:=1;
exit;
end;
ss:=email;
if pos('.',ss)<=0 then
begin
result:=1;
exit;
end;
if pos('.',ss)>0 then
begin
ss:=copy(ss,pos('.',ss)+1,length(ss));
dd:=1;
end;
if (pos('.',ss)>0)and(dd=1) then
begin
result:=1;
exit;
end;
ss:=email;
if (copy(ss,pos('.',ss)+1,3)<>'com')and(copy(ss,pos('.',ss)+1,3)<>'net') then
begin
result:=1;
exit;
end;
result:=0;
end;