在delphi6中IdDecoderMIME1.DecodeString要如何调用了

在路上0122 2014-08-21 03:30:52
function TForm1.Base64Decode(strInput:string):string;
var
strDecode : string;
posStart : Integer;
posEnd : Integer;
// IdDecoderMIME1: TIdDecoderMIME;
begin
while pos('=?gb2312?b?',lowercase(strInput))>0 do
begin
try
posStart:=pos('=?gb2312?b?',lowercase(strInput));
posEnd:=pos('?=',lowercase(strInput));
// strDecode:=strDecode+copy(strInput,1,posStart-1)+IdDecoderMIME1.DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
strDecode:=strDecode+copy(strInput,1,posStart-1)+ DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
strInput:=copy(strInput,posEnd+2,length(strInput)-posEnd-1);
finally
Application.ProcessMessages;
end;
end;
strDecode := strDecode + strInput;
result := strDecode;
end;

这是我在网络抄的代码 ,可是
// strDecode:=strDecode+copy(strInput,1,posStart-1)+IdDecoderMIME1.DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
这句怎么也调试不成功了,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,
...全文
441 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
jenniferhoo 2014-09-04
  • 打赏
  • 举报
回复
D6没有,用UU或者XX那个试试
在路上0122 2014-09-03
  • 打赏
  • 举报
回复
D6的企业版了
Blessed_Chuan 2014-09-03
  • 打赏
  • 举报
回复
你使用的是Indy那个版本呢?
在路上0122 2014-09-03
  • 打赏
  • 举报
回复
好像是的了 unit EncdDecd; interface uses Classes; procedure EncodeStream(Input, Output: TStream); procedure DecodeStream(Input, Output: TStream); function EncodeString(const Input: string): string; function DecodeString(const Input: string): string;
程晨c 2014-09-02
  • 打赏
  • 举报
回复
引用 5 楼 zslcode 的回复:
已经引用了EncdDecd 的
EncdDecd 单元中有没有TIdDecoderMIME类的定义?
在路上0122 2014-09-02
  • 打赏
  • 举报
回复
已经引用了EncdDecd 的
程晨c 2014-09-02
  • 打赏
  • 举报
回复
没有引用EncdDecd 单元吧
在路上0122 2014-09-02
  • 打赏
  • 举报
回复
报的这个错了 undeclared identifier: 'TIdDecoderMIME' 前几天出差,不好意思
Blessed_Chuan 2014-08-21
  • 打赏
  • 举报
回复
IdDecoderMIME1: TIdDecoderMIME; 这个没看到你创建啊

function TForm1.Base64Decode(strInput:string):string;
var
  strDecode : string;
  posStart : Integer;
  posEnd : Integer;
  IdDecoderMIME1: TIdDecoderMIME;
begin
   IdDecoderMIME1:=TIdDecoderMIME.Create(nil);
  while pos('=?gb2312?b?',lowercase(strInput))>0 do
  begin
    try
      posStart:=pos('=?gb2312?b?',lowercase(strInput));
      posEnd:=pos('?=',lowercase(strInput));
      strDecode:=strDecode+copy(strInput,1,posStart-1)+IdDecoderMIME1.DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
      strDecode:=strDecode+copy(strInput,1,posStart-1)+ DecodeString(copy(strInput,posStart+11,posEnd-posStart-11));
      strInput:=copy(strInput,posEnd+2,length(strInput)-posEnd-1);
    finally
      Application.ProcessMessages;
    end;
  end;
  strDecode := strDecode + strInput;
  result := strDecode;
end;
Blessed_Chuan 2014-08-21
  • 打赏
  • 举报
回复
报什么错呢?

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧