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));
这句怎么也调试不成功了,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,急,
10 个解决方案
#1
报什么错呢?
#2
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;
#3
报的这个错了
undeclared identifier: 'TIdDecoderMIME'
前几天出差,不好意思
undeclared identifier: 'TIdDecoderMIME'
前几天出差,不好意思
#4
没有引用EncdDecd 单元吧
#5
已经引用了EncdDecd 的
#6
EncdDecd 单元中有没有TIdDecoderMIME类的定义?
#7
好像是的了
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;
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;
#8
你使用的是Indy那个版本呢?
#9
D6的企业版了
#10
D6没有,用UU或者XX那个试试
#1
报什么错呢?
#2
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;
#3
报的这个错了
undeclared identifier: 'TIdDecoderMIME'
前几天出差,不好意思
undeclared identifier: 'TIdDecoderMIME'
前几天出差,不好意思
#4
没有引用EncdDecd 单元吧
#5
已经引用了EncdDecd 的
#6
EncdDecd 单元中有没有TIdDecoderMIME类的定义?
#7
好像是的了
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;
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;
#8
你使用的是Indy那个版本呢?
#9
D6的企业版了
#10
D6没有,用UU或者XX那个试试