如何打开最大化的Internet Explorer? [英] How do I open maximized internet explorer?

查看:96
本文介绍了如何打开最大化的Internet Explorer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用C#打开最大化的Internet Explorer.我尝试了以下方法:

I have to open maximized internet explorer using C#. I have tried the following:

try
{
    var IE = new SHDocVw.InternetExplorer();
    object URL = "http://localhost/client.html";

    IE.ToolBar = 0;
    IE.StatusBar = true;
    IE.MenuBar = true;
    IE.AddressBar = true;
    IE.Width = System.Windows.Forms.SystemInformation.VirtualScreen.Width;
    IE.Height = System.Windows.Forms.SystemInformation.VirtualScreen.Height;

    IE.Visible = true;

    IE.Navigate2(ref URL);
    ieOpened = true;

    break;
}
catch (Exception)
{

}

我可以打开不同大小的文件,但是找不到打开最大IE的方法.我已经检查了 msdn ,没有最大化的属性.

I can open with different sizes, but I couldn't find how to open maximized IE. I have checked the msdn, there is no property to for maximize.

请给我一些建议.

PS:我正在开发C#控制台应用程序,.Net4.5和VS2012

PS: I am developing C# console application, .Net4.5, and VS2012

推荐答案

我会使用处理方法.

  1. 您可以启动任何可执行文件,并且
  2. 它具有一个使您的过程最大化的属性

  1. You could start any executable and
  2. It has a property which starts your process maximized

ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Maximized;
startInfo.Arguments = "www.google.com";

Process.Start(startInfo);

这篇关于如何打开最大化的Internet Explorer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆