如题,不要其他的信息,只要URL,请各位高手指教
解决方案 »
- 给出一个文件的Url地址,下载到指定目录,不要有下载对话框
- 如何正确写法
- 树形控件问题,在线等!!(100)
- 怎样让PC的喇叭闭嘴?我的音量调节里面没有这一项!
- “类没有注册”的问题---急用
- 谁有桌面宠物的delphi源代码?
- 如何在两台电脑之间通过internet传输图片
- 新编写一组件,怎么也通不过编译,高手快进来看看
- 关于主从表数据插入的问题,求教!
- ADO害死我了:我用DELPHI编写的ACCESS数据库在网络上共享,可是户多了就出错,怎么办?,请高手指点!
- 求助:有关idftp控件中directorylisting 的问题
- 我的windows键+E被禁用了,其它没事,即打开浏览器的快捷键,如何解除呀
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, shellapi, ddeman, shdocvw,registry;type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure ListBox1DblClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
IEXPLORE:string;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}
procedure TForm1.ListBox1DblClick(Sender: TObject);
begin
WinExec(PChar(IEXPLORE+' "'+listbox1.items[listbox1.itemindex]+'"'),SW_NORMAL);
end;procedure TForm1.Button1Click(Sender: TObject);
const
maxx = 30;
var
ShellWindow: IShellWindows;
nCount: integer;
spDisp: IDispatch;
i: integer;
vi: OleVariant;
IE1: IWebBrowser2;
begin
listbox1.clear;
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
for i := 0 to nCount - 1 do
begin
vi := i;
try
spDisp := ShellWindow.Item(vi);
except
exit
end;
if (spDisp <> nil) then
begin
try
spDisp.QueryInterface(iWebBrowser2, IE1);
except
on EAccessViolation do
begin
exit
end;
end;
if (IE1 <> nil) then
begin
listbox1.items.add(IE1.Get_LocationURL());
end;
end;
end;
deletefile(extractfilepath(paramstr(0)) + 'Address.d' + inttostr(maxx));
for i := maxx - 1 downto 0 do
renamefile(extractfilepath(paramstr(0)) + 'Address.d' + format('%.2d', [i]), 'Address.d' + format('%.2d', [i + 1]));
listbox1.items.savetofile(extractfilepath(paramstr(0)) + 'Address.d00');
end;procedure TForm1.Button2Click(Sender: TObject);
var
i: integer;
begin
for i := 0 to listbox1.items.count - 1 do
begin
WinExec(PChar(IEXPLORE+' "'+listbox1.items[i]+'"'),SW_NORMAL);
end;
end;procedure TForm1.FormShow(Sender: TObject);
var
s: string;
reg:TRegistry;
begin
s := extractfilepath(paramstr(0)) + 'Address.d00';
if fileexists(s) then
listbox1.items.loadfromfile(s);
reg:=TRegistry.create;
reg.rootkey:=HKEY_LOCAL_MACHINE;
reg.openkey('Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE',true);
IEXPLORE:=reg.ReadString('');
reg.closekey;
reg.free;
end;end.可以参考一下