G
gwdb
Unregistered / Unconfirmed
GUEST, unregistred user!
谁能帮我把以下一个indy附带收email的一段代码翻译成C++ Builder 5的形式的代码?
主要是注释部分,谢谢。
ShowStatus('Decoding attachments (' + IntToStr(Msg.MessageParts.Count) + ')');
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
//这一句
begin
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
//这一句
begin
//general attachment
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption := TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
////这一句
li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType);
//这一句
end
else
begin
//body text
if Msg.MessageParts.Items[intIndex] is TIdText then
//这一句
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
////这一句
end
end;
end;
主要是注释部分,谢谢。
ShowStatus('Decoding attachments (' + IntToStr(Msg.MessageParts.Count) + ')');
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
//这一句
begin
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
//这一句
begin
//general attachment
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption := TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
////这一句
li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType);
//这一句
end
else
begin
//body text
if Msg.MessageParts.Items[intIndex] is TIdText then
//这一句
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
////这一句
end
end;
end;