找找以前的帖子吧,
d5也可以,但是麻烦些
d5也可以,但是麻烦些
解决方案 »
- delphi实现导出pdf功能,求助用什么方法
- 郁闷啊,散分!!!!!!!!!!!!!!!!!!!!!
- delphi中接口部分的private和public到底做什么用的?
- Asp.net调用 Delphi 编写的 DLL(library)(非COM)
- 【倒分热线】黑名单又添加新成员?!
- 如何截获Windows消息???
- 用什么方法可以把DBGrid查询的内容打印处理,查询是用sql语句的,有什么好控件?
- InterBase server安装的注册码是多少?
- GetFieldNames出错!
- 我想给菜单控件加上颜色
- 谁知道nmhttp的post方法中post的数据格式?
- 自动增长的记录号如何实现
const
BaseTable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var
Times, LenSrc, i: Integer;
x1, x2, x3, x4: Char;
xt: Byte;
begin
Result := '';
LenSrc := Length(Source);
if LenSrc mod 3 = 0 then
Times := LenSrc div 3
else
Times := LenSrc div 3 + 1;
for i := 0 to Times - 1 do
begin
if LenSrc >= (3 + i * 3) then
begin
x1 := BaseTable[(ord(Source[1 + i * 3]) shr 2)+1];
xt := (ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
xt := xt or (Ord(Source[3 + i * 3]) shr 6);
x3 := BaseTable[xt + 1];
xt := (ord(Source[3 + i * 3]) and 63);
x4 := BaseTable[xt + 1];
end
else if LenSrc >= (2 + i * 3) then
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2) + 1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (Ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
x3 := BaseTable[xt + 1];
x4 := '=';
end else
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2)+1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
x2 := BaseTable[xt + 1];
x3 := '=';
x4 := '=';
end;
Result := Result + x1 + x2 + x3 + x4;
end;
end;连接时的验证代码也给出来吧
procedure TForm1.FSMTPConnect(Sender: TObject);
var
passw,useri:string;
begin
passw:=passs; //取密码
useri:=copy(adds,1,pos('@',adds)-1);
if FSMTP.ReplyNumber = 250 then
FSMTP.Transaction('auth login');
if FSMTP.ReplyNumber = 334 then
begin
FSMTP.Transaction(EncodeBase64(useri));
FSMTP.Transaction(EncodeBase64(passw));
end;end;