全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1622
推到 Plurk!
推到 Facebook!

End of TStream??

答題得分者是:william
ralph
初階會員


發表:41
回覆:82
積分:29
註冊:2003-02-04

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-23 11:40:53 IP:66.171.xxx.xxx 未訂閱
How can I know I am on end of TStream???? Thank you!
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-23 12:03:43 IP:147.8.xxx.xxx 未訂閱
When its Position = Size 
ralph
初階會員


發表:41
回覆:82
積分:29
註冊:2003-02-04

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-24 02:45:38 IP:66.171.xxx.xxx 未訂閱
Hi william : Q1: How can I move the stream from beginning(Position:=0) to the end(Position:=size)?? Q2: Are you sure Position:= size is "end of stream"?? I do Indy SMTP server example. I tried to save VStream into the file. I found if I set postion:= VStream.Size, it is not end of stream when you send the mail with attachment. The attachment can be save into file with MIME format. 發表人 - ralph 於 2003/04/24 02:47:08
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-24 09:07:39 IP:147.8.xxx.xxx 未訂閱
1) Stream.Position := Stream.Size; Stream.Seek(0,soFromEnd); 2) Yes... or should you use Position>=Size instead? I have tested memory stream can set position beyond size (and even a read?) and no error... for file stream I think you would get error for reading beyond the end of the stream. I don't have the indy demo, but would VStream be rewinded back before a save? 發表人 - william 於 2003/04/24 09:22:51
ralph
初階會員


發表:41
回覆:82
積分:29
註冊:2003-02-04

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-25 10:14:11 IP:66.171.xxx.xxx 未訂閱
There is a strange part.    I compile Indy SMTP server and tried to save VStream into the file. It could be saved. Here is a strange part. If you receive a mail with attachment (the file is like below) and you set Position:= VStream.Size, the line will be at "This is a multi-part message in MIME format".    It is not end of VStream. why??? Is it strange, isn't it???    Ho can I save Attachment from the file like below???        From: p@hotmail.com To: p@hotmail.com Subject: 3213edewdw Date: Thu, 24 Apr 2003 20:11:24 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed;         boundary="----=_NextPart_000_0007_01C30A9D.AE2995D0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106    This is a multi-part message in MIME format    ------=_NextPart_000_0007_01C30A9D.AE2995D0 Content-Type: multipart/alternative;         boundary="----=_NextPart_001_0008_01C30A9D.AE2995D0"    ------=_NextPart_001_0008_01C30A9D.AE2995D0 Content-Type: text/plain;         charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable    f432fterfvarea ------=_NextPart_001_0008_01C30A9D.AE2995D0 Content-Type: text/html;         charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff>
f432fterfvarea
</BODY></HTML> ------=_NextPart_001_0008_01C30A9D.AE2995D0-- ------=_NextPart_000_0007_01C30A9D.AE2995D0 Content-Type: text/plain; name="yy.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="yy.txt" ICAgICAgICAgICAgICAgIKhxqFSoVKhUqFSoVKhUqFSoVKhUqFSoVKhUqFSoVKhUqHINCiAgICAg ICAgICAgICAgICCoVSAgICAgICAgqef2rbeyyO28/j0tICAgICAgICAgIKhVDQogIKhxqFSoVKhU qFSoVKhUqcggICAgIGh0dHA6Ly93d3cuY3Jza3kuY29tICAgICCpwKhUqFSoVKhUqFSoVKhyDQog IKhVICAgICAgICAgICAgqFUgICAgIGh0dHA6Ly93d3cuY3Jza3kubmV0ICAgICCoVSAgICAgICAg ICAgIKhVDQogIKhVICAgICAgICAgICAgqHSoVKhUqFSoVKhUqFSoVKhUqFSoVKhUqFSoVKhUqFSo cyAgICAgICAgICAgIKhVDQqhoahVICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIKhVDQqhoahVICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIKhVDQqhoahVoaHJ cP3o7qxvrPM0PLTyfat t7LI7bz y9G8r9X7wO2jrLK7s9C1o7y8yvW8sLDmyKjOysziICAgIKhVDQogIKhVICDLtcP3o7rS qrvxtcO4/LbgtcSzzNDyu/LX7tDCsOaxvsfry bKsbnY16L2rbeyyO28/iAgICAgIKhVDQogIKhV ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IKhVDQogIKhVICAgICAg9q23ssjtvP7M4bmptPPBv7XEyczStcjtvP6jrMbGveLXorLhtcjP4LnY z8LU2CAgICAgIKhVDQogIKhVICDDv8jVsru2qMqxtuC0zrj80MKjrMir0MTL3NTszt7Tx8jtvP61 xMrAzeLM0tS0ISAgICAgICAgIKhVDQqhoahVICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIKhVDQogIKhVICAgIKhxqaSppKmkqaSppKmkqaSp pKmkqaSppKmkqaSppKmkqaSppKmkqaSppKmkqaSppKhyICAgIKhVDQogIKh0qFSoVKnIICAgICAg IMLbzLPT8sP7o7piYnMuY3Jza3kuY29tICAgICAgICAgICAgICAgIKnAqFSoVKhzDQogICAgICAg IKh0qaSppKmkqaSppKmkqaSppKmkqaSppKmkqaSppKmkqaSppKmkqaSppKmkqaSppKhzDQotLT09 IENQVUlkbGUgUHJvIHY2LjBiIGZvciBXaW4yMDAwL1hQINeo0rXB48rbsOYgPT0tLQ0KDQpDcHVJ ZGxlxNy5u8/U18W1xL21tc1DUFXUy9DQyrG1xM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eisuHC68rkyOvAuMTateO799eisuGx47/JzeqzydeisuGjocTatObXorLhu/rWu8Tc08PT 2s/gzayw5rG yO28/qOsx vXotLiusu21LDmsb66xaGjDQoNCsbGveKyubahtcTKudPDt723qKO6 DQqw0cbGveKyubahv72xtLW9s8zQ8sv51NrEv8K8o6zWtNDQo6yx47/Jzeqzyc7EvP61xNDesrm2 oaOsvLS/yb3ivvbI7bz 1K3T0LXEuPfW1s/e1sajoQ0Kz9bU2tChsr 31rn6xNrJsba yO28/rDR 16Ky4bv6o6jM2LHwysfE2rTm16Ky4bv6o6mxqLjmzqqyoba o6jSu7DjsajOqmhhY2sucHN3LmZv eG1haWyyoba o6nV4srHzqrBy7Tyu/fGxr3io6y1wbDmoaPI57n7xOO 9bXDyO28/rrD08OjrL2o 0unP8tf31d/XorLhu/K5usLyo6HI57n7xOO21M7zsaiyoba utzU2rr1o6zH67K70qrPwtTYyrnT w6GjztLDx8zhuam1xMjtvP6 ocG/suLK1Lrzyc 0q7XELg== ------=_NextPart_000_0007_01C30A9D.AE2995D0-- .
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-25 10:59:03 IP:147.8.xxx.xxx 未訂閱
Make sure Position means VStream.Position, i.e. VStream.Position := VStream.Size.    Although I have little expereince with Indy, I think there is no need to parse the email yourself. You could set ReceiveMode to rmMessage and get the message as a TIdMessage in the OnReceiveMessage event. 
ralph
初階會員


發表:41
回覆:82
積分:29
註冊:2003-02-04

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-04-25 23:13:08 IP:66.171.xxx.xxx 未訂閱
>Although I have little expereince with Indy, I think there is no >need to parse the email yourself. You could set ReceiveMode to >rmMessage and get the message as a TIdMessage in the >OnReceiveMessage event.     But how can we get an Attachment??  We may set rmMessage or rmMessageParsed to get message of the mail and sender's address.     By the way, Thanks for your answer! 
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-04-26 10:06:07 IP:210.3.xxx.xxx 未訂閱
引言: >Although I have little expereince with Indy, I think there is no >need to parse the email yourself. You could set ReceiveMode to >rmMessage and get the message as a TIdMessage in the >OnReceiveMessage event. But how can we get an Attachment?? We may set rmMessage or rmMessageParsed to get message of the mail and sender's address. By the way, Thanks for your answer! < face="Verdana, Arial, Helvetica"> No experience
系統時間:2024-05-20 23:02:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!