Var
StrDecode: string;
PosStart: Integer;
PosEnd: Integer;
//IdDecoderMIME1: TIdDecoderMIME;
The begin
While pos ('=? Gb2312? b? ', lowercase (strInput)) & gt; 0 do
The 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);
The finally
Application. ProcessMessages;
end;
end;
StrDecode:=strDecode + strInput;
Result:=strDecode;
end;
This is my copy of the code in the network, but
//strDecode:=strDecode + copy (strInput, 1, posStart - 1) + IdDecoderMIME1. DecodeString (copy (strInput posStart + 11, posEnd posStart - 11));
This sentence can't debugging success, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent, urgent,
CodePudding user response:
To what's wrong?CodePudding user response:
IdDecoderMIME1: TIdDecoderMIME; This didn't see you create
The function TForm1. Base64Decode (strInput: string) : string;
Var
StrDecode: string;
PosStart: Integer;
PosEnd: Integer;
IdDecoderMIME1: TIdDecoderMIME;
The begin
IdDecoderMIME1:=TIdDecoderMIME. Create (nil);
While pos ('=? Gb2312? b? ', lowercase (strInput)) & gt; 0 do
The 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);
The finally
Application. ProcessMessages;
end;
end;
StrDecode:=strDecode + strInput;
Result:=strDecode;
end;
CodePudding user response:
At the wrongUndeclared identifier: 'TIdDecoderMIME'
A few days ago on a business trip, sorry
CodePudding user response:
No reference EncdDecd unit.CodePudding user response:
Has cited EncdDecdCodePudding user response: