| 发表于:2008-01-17 19:55:034楼 得分:0 |
procedure tfrmchat.sendfile; var filestream:tfilestream; begin filestream:=tfilestream.create(open1.filename, fmopenread); try nmstrm1.host :=address ; nmstrm1.fromname :=extractfilename(open1.filename); nmstrm1.postit(filestream); frmmain.send('t',userhandle,datetimetostr(now)+#13+'系统消息: 已接收文件'+nmstrm1.fromname+#13,lbuser.caption,frmmain.myid,id,'1',''); frmmain.displaytext(btext.lines,'已发送文件'+nmstrm1.fromname,'系统消息'); sendmessage(btext.handle,em_scroll,sb_bottom,0); finally filestream.free ; frmmain.sent :=false; end; end; | | |
|