Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Delphiµ÷ÓÃoutlook

 //¶¨ÒåÈ«¾Ö±äÁ¿
public
{ Public declarations }
outlook,MailItem,Recipient:variant;
OutlookNameSpace:variant;
OutlookFolder:variant;
OutlookAttachment:variant;
//´´½¨´ò¿ªoutlook
procedure TForm1.CreateOutLook;
begin
try
outlook:=CreateOleObject('OutLook.application');
except
Outlook:=GetActiveOleObject('Outlook.Application');
end;
OutlookNameSpace:=Outlook.GetNamespace('MAPI');
OutlookFolder:=OutlookNameSpace.GetDefaultFolder(6);
MailItem:=OutlookFolder.items;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
CreateOutLook;
WebBrowser1.Navigate('about:');
end;
//ËÑË÷δ¶ÁÓʼþ ²¢ÓÃwebbrowser1ÏÔʾÓʼþÄÚÈÝ
procedure TForm1.bt_SearchMailClick(Sender: TObject);
var
sch:Variant;
Smail:Variant;
strF:string;
i:integer;
mailbody:WideString;
begin
strF:='[senderEmailAddress]="%s" and [unread]=true';
strF:=Format(strF,[Trim(Edit1.Text)]);
sch:=MailItem.Restrict(strF);
mailbody:='ÕÒµ½·ûºÏÌõ¼þµÄÓʼþÊýÁ¿£º'+inttostr(sch.count);
for i:=1 to sch.count do
begin
Smail:=sch.item[i];
mailbody:=mailbody+Smail.HTMLBody;
end;
(webbrowser1.Document as IHtmlDocument2).body.innerHTML:='<div>'+mailbody+'</div>';
end;
//·¢ËÍÓʼþ
procedure TForm1.tb_SendMailClick(Sender: TObject);
begin
MailItem:=outlook.CreateItem(0);
MailItem.BodyFormat:=2;
MailItem.HTMLBody:='<html><Body>'
+'HI:<br>  ÄãºÃ!ºÜ¾Ã²»¼û£¬×î½ü¿ÉºÃ£¿'
+'</body></html>';
MailItem.Recipients.add('baronyang@foxmail.com');
MailItem.Subject:='ÖÂÅóÓÑ';
MailItem.Attachments.add('F:\MyFiles\login.ini');
MailItem.Attachments.add('F:\MyFiles\XXXXX.doc');
MailItem.Display;
end;


Ïà¹ØÎĵµ£º

delphi ½Å±¾ÒýÇæ±È½Ï

TMS Scripter£ºÖ§³ÖPascalºÍVBScriptÁ½ÖÖÓï·¨¡£ÓŵãÊÇÎĵµÆëÈ«¡¢Àý×ÓÆëÈ«£¬½Å±¾¿ÉÖ±½ÓÖ§³ÖDLL£¬¹Ù·½»¹ÌṩÁ˷ḻµÄIDE Debug¹¤¾ß¡¢µ¥Ôªµ¼³öº¯Êý¹¤¾ßµÈ£¬È±µãÊDZàÒëÔËÐнÏÂý¡£for ¿ÕÑ­»·1000Íò´Î£¬ÐèÒª10ÃëÖÓÒÔÉÏ¡£TMS ScripterÊÇÉÌÒµ¹²ÏíÈí¼þ¡£
       FastScript£ºÓùýFastReport±¨±íµÄÍ¬Ñ ......

delphiÏ̳߳ء¾×ª¡¿


[code=Delphi(Pascal)]
unit uThreadPool;
{  aPool.AddRequest(TMyRequest.Create(RequestParam1, RequestParam2, ...)); }
interface
uses
  Windows,
  Classes;
// ÊÇ·ñ¼Ç¼ÈÕÖ¾
// {$DEFINE NOLOGS}
type
  TCriticalSection = class(TObject)
  protected
    FSec ......

delphiµ÷ÓÃÑ¡ÔñĿ¼¶Ô»°¿ò

delphiµ÷ÓÃÑ¡ÔñĿ¼¶Ô»°¿ò
¾­³£¼ûÍøÉÏÓÐÈËÎÊÑ¡ÔñĿ¼¶Ô»°¿òµÄ¿Ø¼þ£¬ÆäʵֻÓÃÒ»¸öº¯Êý¾Í¿ÉÒÔʵÏÖ¡£
×¢ÒâÒýÓÃ Filectrl µ¥Ôª
use Filectrl;
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: String;
begin
SelectDirectory('Select a directory', '', Dir);
ShowMessage(Dir);
end; ......

delphiµ÷ÓÃExcel²éÕÒ¶¨Î»

var
ExcelFile:string;
SourceRange,DesRange:Variant;
Row,Column,i:integer;
begin
if OpenDialog1.Execute then
begin
ExcelFile:=OpenDialog1.Files[0];
if not FileExists(ExcelFile) then Exit;
end
else
Exit;
try
ExcelApp:=CreateOleObject('Excel.Application');
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ