求一个函数,能自动向IE网址输入栏中填写上网址,能用的。
比如,一运行,自动打开ie,并自动的在ie浏览器网址输入框中输入http://www.sina.com.cn 就这样,求一个函数,

解决方案 »

  1.   

    uses ShellAPI,ComObj;
    procedure OpenInIE(aURL: string);
        var IE: Variant;
    begin
        IE := CreateOleObject('InternetExplorer.Application');
        IE.Visible := true;
        IE.Navigate(aURL);
    end;
    aURL 是网址,记得uses里一定加上ShellAPI,ComObj
      

  2.   

    uses shellapi;默认浏览器:
    ShellExecute(0, 'open', 'www.xxoo.com', nil, nil, sw_shownormal);
    指定浏览器:
    ShellExecute(0, 'open', 'iexplore.exe','www.xxoo.com', nil, sw_shownormal);
      

  3.   

    比如,一运行,自动打开ie,并自动的在ie浏览器网址输入框中输入http://www.sina.com.cn  把这句话拆解分条,过程应该如下:
    1、打开ie浏览器
    2、浏览器地址栏,自动输入http://www.sina.com.cn
    而不是直接“用ie打开某网址”。那样是简单了不老少,我会。
      

  4.   

    写一个.vbs文件:
    Set oIE = GetObject("", "InternetExplorer.Application")
    oIE.Visible = True
    Set oShell = GetObject("", "WScript.Shell")
    oShell.AppActivate "Internet Explorer"
    oShell.SendKeys "%d"
    WSH.Sleep 100
    oShell.SendKeys "http://www.sina.com.cn"Set oShell = Nothing
    Set oIE = Nothing
      

  5.   


    这个是我说的效果,很佩服,但是我想是在delphi中实现,能有会的吗?
      

  6.   


    uses ComObj;procedure TForm1.Button1Click(Sender: TObject);
    var
      V: Variant;
    begin
      V := CreateOleObject('InternetExplorer.Application');
      V.Visible := True;
      V := Unassigned;
      V := CreateOleObject('WScript.Shell');
      V.AppActivate('Internet Explorer');
      V.SendKeys('%d');
      Sleep(100);
      V.SendKeys('http://www.sina.com.cn');
      V := Unassigned;
    end;