DelPhiÏÂÓÃCDO·¢ËÍÓÊÏäʵÀý
Ïà¶ÔÓõÚÈý·½¿Ø¼þ£¬CDO·¢ËÍÓʼþ»¹ÊǺܼò½à·½±ãµÄ
×¢£ºCDONTSΪCDOµÄ×Ó¼¯£¬½öÖ§³ÖWinNT/Win2K£¬WinXPÒÔÉÏÇëÓÃCDO;
µ¥ÔªÒýÓÃComObj;
procedure TForm1.Button1Click(Sender: TObject);
var
VCDOMessage:oleVariant;
begin
vCDOMessage:=CreateOleObject('CDO.Message');
vcdomessage.from:='MR.F'+'<XXXX@163.com>'; //¼ÓºÅÇ°ÃæΪ·¢¼þÈËÏÔʾÃû³Æ£¬¼ÓºÅºóÃæΪ·¢¼þÈËÓÊÏ䣻
vcdomessage.to:='XXXX@qq.com'; //ÊÕÐÅÈ˵ÄÓÊÏä
vcdomessage.Subject:='²âÊÔ';
vcdomessage.TextBody:='·¢Ëͳɹ¦';
vcdomessage.addAttachment('XXXX'); //¸½¼þ£¬ÒýºÅÄÚΪ¸½¼þ·¾¶Ãû
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/sendusing'):=2;
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/smtpserver'):='smtp.163.com'; //ÐÞ¸ÄÏàÓ¦·¢ËÍÓÊÏäµÄsmtp
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/smtpserverport'):=25;
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/smtpauthenticate'):=1;
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/sendusername'):='XXXX';//·¢ÐÅÓÊÏäµÄÓû§Ãû
vcdomessage.Configuration.Fields.item('http://schemas.microsoft.com/cdo/configuration/sendpassword'):='XXXX';//·¢ÐÅÓÊÏäµÄÃÜÂë
vcdomessage.Configuration.Fields.update;
VCDOmessage.send;
end;
Ïà¹ØÎĵµ£º
ÔÚWIN32ÖеĴ®¿ÚͨѶ£¨Delphi£©
ÓÉÔÚWIN32²Ù×÷ϵͳÖнûÖ¹Ó¦ÓóÌÐòÏóDOSÖÐÄÇÑùÖ±½Ó·ÃÎʼÆËã»úÓ²¼þ£¬Òò´Ë£¬ÎÞ·¨ÏóÒÔÇ°ÄÇÑù²ÉÓÃÖж϶Áд´®¿Ú¡£µ«ÊÇÔÚWIN32ÖÐÎÒÃÇ¿É·¢²ÉÓÃÁ½ÖÖ·½·¨·ÃÎÊ´®¿Ú£º1¡¢Ê¹ÓÃVBÖеÄMSCOMM´®¿Ú¿Ø¼þ£»2¡¢²ÉÓÃAPIº¯Êý£¬±¾ÎÄÖ÷Òª½éÉܲÉÓÃAPIº¯ÊýʵÏÖ´®¿ÚͨѶ¡£
ÓÉÓÚWM_COMMNOTIFYÏûÏ¢Òѱ»È¡Ïû£¬¹Ê±¾ÎÄ×Ô¶ ......
MSHTMLÊÇ΢Èí¹«Ë¾µÄÒ»¸öCOM×é¼þ£¬¸Ã×é¼þ·â×°ÁËHTMLÓïÑÔÖеÄËùÓÐÔªËؼ°ÆäÊôÐÔ£¬Í¨¹ýÆäÌṩµÄ±ê×¼½Ó¿Ú£¬¿ÉÒÔ·ÃÎÊÖ¸¶¨ÍøÒ³µÄËùÓÐÔªËØ£®
¡¡¡¡MSHTML¶ÔÏóÄ£ÐÍÊÇÓÉһЩ¶ÔÏóºÍ¼¯ºÏ×é³ÉµÄ£®´¦ÓÚ¸ù²¿µÄÊÇHTML£¬ÃèÊöÁË´ò¿ªÒ³ÃæµÄ1¸ö´°¿Ú£¬°üÀ¨Ò»ÏµÁм¯ºÏºÍ¶ÔÏó¡£ÈçFrames¼¯ºÏ£¬History£¬Location£¬Navigator£¬Document£¬Vi—sum ......
Delphi UÅ̲åÈ벦³ö¼ì²â£º
1¡¢Ð½¨¹¤³Ì£»
2¡¢ÔÚform1ÉÏ·ÅÒ»¸öLabel£»
3¡¢¶¨ÒåÒ»¸ö˽Óйý³Ì
procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
ÍêÕû´úÂëÈçÏ£º
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics ......
¾àÀëÉÏһƪϵÁеÄÎÄÕÂÓÐÒ»¶Îʱ¼äÁË£¬¼ÙÖÕÓÚÊÇ·ÅÍêÁË£¡ÏÖÔÚÔÛ¼ÌÐøÔÚTEditÉÏ×öÎÄÕ£¬Í¬Ê±À´ÊìϤijЩWindowsµÄϵͳÏûÏ¢¡£ÏÖÔÚÎÒ½²µÄÊÇÈçºÎʵÏÖÒ»¸öÀàËÆQQ±à¼¿òµÄÑùʽ¡£
ÔÙ½²½â֮ǰ£¬ÏÈ»ØÀ¡Ç°¼¸ÆªÎÄÕÂÓÐЩÈËÌá³öµÄÎÊÌ⡣ͨ¹ýÇ°¼¸ÆªÎÄÕ£¬ÓкܶàÈ˹Ø×¢£¬Í¬Ê±Ò²ÓÐÈ˸øÁËһЩ½¨Òé¡£ËùÒÔÎÒÕâÀï˵Ã÷һϣ¬ÎÒÕâ¸ö×é¼ ......
ÔÚÍøÉÏ¿´µ½ºÜ¶àÈ˶¼ÔÚΪDelphiÊÇ·ñÖ§³ÖC++/JavaÖеľ²Ì¬±äÁ¿¼°¾²Ì¬·½·¨µÄ¹¦ÄܶøÀ§ÈÅ,ÆäʵÕâÔÚDelphiÖÐÊǺܼòµ¥µÄ.
¾²Ì¬·½·¨¾ÍÊÇʹÓÃClass Function. ¾²Ì¬±äÁ¿ÔòʹÓõ¥Ôª¾Ö²¿±äÁ¿À´ÊµÏÖ. ´úÂëÈçÏÂ:
//=========================================
// StaticVarTestU - ¶¨ÒåÁË¿ÉÒÔ¼ÆÊýµÄÀ࣬ͨ¹ýÀà·½·¨¼´¿É·ÃÎÊ´ËÀàµÄ¶ÔÏóÊý ......