Delphi带了很多的Internet应用编程控件,这使得我们开发Internet的应用程序可以轻松些,下面我将逐步介绍一些关于Internet下应用程序编程技巧,这些技巧都是一些细微的方面,但是它却可以给你的应用程序添加重要的功能,将使你开发Internet下的应用程序事半功倍。
说过开场旁白后,首先介绍:设置系统默认浏览器和系统默认电子邮件收发软件。
1.获得默认的internet浏览器地址函数:
下面的函数是通过读取注册表的设置后,得到默认Internet的浏览器所在地址
function GetDefaultShellHTTP : string;
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT;
if Reg.KeyExists(’http\shell\open\command’) then
begin
Reg.OpenKey(’http\shell\open\command’,false);
Result:=Reg.ReadString(’’);
end
else
Result:=’’;
Reg.Free;
end;
2.设置internet浏览器
procedure SetDefaultShellHttp(CmdLine : string);
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT; //注册表的地址:
Reg.OpenKey(’http\shell\open\command’,true);//注册表的地址:
Reg.WriteString(’’,CmdLine);
Reg.Free;
end;
setDefaultshellhttp(’"C:\PROGRA~1\INTERN~1\iexplorer.exe" -nohome’);
3.获得和设置默认的E-Mail 收发软件的函数
下面的函数是通过读取注册表的设置后,得到默认E-mail收发软件所在地址
function GetDefaultMail : string;
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT;
if Reg.KeyExists(’Mailto\shell\open\command’) then
begin
Reg.OpenKey(’Mailto\shell\open\command’,false);
Result:=Reg.ReadString(’’);
end
else
Result:=’’;
Reg.Free;
end;
4.设置默认邮件箱
procedure SetDefaultMail(CmdLine : string);
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT;
Reg.OpenKey(’Mailto\shell\open\command’,true);
Reg.WriteString(’’,CmdLine);
Reg.Free;
end;
使用
//SetDefaultMail(’E:\FoxMail\FoxMail.exe -T "%1" -S "%2"’);
| Visual C++编程窃取QQ密码 | 12-08 | |
| 编程实现重起网卡等设备 | 12-07 | |
| 一个邮件群发的Delphi代码! | 12-06 | |
| Delphi下Internet的编程技巧 | 11-20 | |
| Delphi黑客编程-如何映射虚拟盘 | 11-15 | |
| 用DETOURS库获取NT管理员权限 | 11-08 | |
| 一篇关于vb代码质量提高的文章 | 10-30 | |
| 解析Asp.net木马文件操作 | 10-04 | |
| 盗QQ源码 | 10-01 | |
| 如何映射肉鸡磁盘(Delphi黑客编程 | 09-24 | |
| 打造无DLL版穿墙Downloader(Delp | 09-22 | |
| 调用指定的Windows程序(Delphi编 | 09-19 | |