Home > Back-end >  In delphi6 IdDecoderMIME1. DecodeString how to call
In delphi6 IdDecoderMIME1. DecodeString how to call

Time:09-30

The function TForm1. Base64Decode (strInput: string) : string;
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 wrong

Undeclared identifier: 'TIdDecoderMIME'

A few days ago on a business trip, sorry

CodePudding user response:

No reference EncdDecd unit.

CodePudding user response:

Has cited EncdDecd

CodePudding user response:

reference 5 floor zslcode reply:
has cited EncdDecd

EncdDecd TIdDecoderMIME class definition of unit?

CodePudding user response:

If yes
The unit EncdDecd;

Interface

USES Classes;

Procedure EncodeStream (Input, Output: TStream);
Procedure DecodeStream (Input, Output: TStream);
The function EncodeString (const Input: string) : string;
The function DecodeString (const Input: string) : string;

CodePudding user response:

The version you are using the Indy?

CodePudding user response:

D6 enterprise edition

CodePudding user response:

D6, try the UU or XX that
  • Related