zoukankan      html  css  js  c++  java
  • Delphi7 获取默认浏览器 打开指定网页url地址

    来自

    unit Unit1;

    百度

     

    interface

     

    uses

    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

    Dialogs, StdCtrls,Registry,ShellAPI;

     

    type

    TForm1 = class(TForm)

    lbl1: TLabel;

    edt1: TEdit;

    lbl2: TLabel;

    edt2: TEdit;

    btn1: TButton;

    btn2: TButton;

    procedure FormCreate(Sender: TObject);

    private

    { Private declarations }

    public

    { Public declarations }

    end;

     

    var

    Form1: TForm1;

     

    implementation

     

    {$R *.dfm}

     

    procedure TForm1.FormCreate(Sender: TObject);

     

    var

    reg: TRegistry;

    s: String;

     

    begin

    reg := TRegistry.Create;

    reg.RootKey := HKEY_CLASSES_ROOT;

    reg.OpenKey('HTTPShellopencommand',False);

    s := reg.ReadString('');//读取注册表的值 如:"D:Program FilesMaxthon3BinMaxthon.exe" "%1"

    s := Copy(s,Pos('"',s)+1,Length(s));//提取路径信息

    s := Copy(s,1,Pos('"',s)-1);

    ShellExecute(handle, 'open',PChar(s), PChar('http://www.ccqgn.com'), nil,sw_shownormal);//指定打开网页

    end;

     

    end.

     

     

    文库
  • 相关阅读:
    模块与包的导入
    递归
    day04
    装饰器2_根据认证来源判断用户和计算登录时间
    装饰器1_统计时间函数装饰欢迎登录函数
    tail -f a.txt | grep 'python'
    函数
    内置函数1
    python模块整理
    VBS恶作剧代码
  • 原文地址:https://www.cnblogs.com/jijm123/p/14081965.html
Copyright © 2011-2022 走看看