在IE中打开一个网页使用c#

如何在IE中打开网页,同时点击c#应用程序中的按钮。
我的目的是创建一个需要在IE中以指定的宽度和高度打开的c#应用程序的Web登录,并且需要在应用程序中调用一个函数

解决方法

http://msdn.microsoft.com/en-us/library/system.diagnostics.process(VS.71).aspx
using System;
using System.Diagnostics;
using System.ComponentModel;

namespace MyProcessSample
{
    /// <summary>
    /// Shell for the sample.
    /// </summary>
    public class MyProcess
    {

        /// <summary>
        /// Opens the Internet Explorer application.
        /// </summary>
        public void OpenApplication(string myFavoritesPath)
        {
            // Start Internet Explorer. Defaults to the home page.
            Process.Start("IExplore.exe");

            // display the contents of the favorites folder in the browser.
            Process.Start(myFavoritesPath);

        }

        /// <summary>
        /// Opens urls and .html documents using Internet Explorer.
        /// </summary>
        public void OpenWithArguments()
        {
            // url's are not considered documents. They can only be opened
            // by passing them as arguments.
            Process.Start("IExplore.exe","www.northwindTraders.com");

            // Start a Web page using a browser associated with .html and .asp files.
            Process.Start("IExplore.exe","C:\\myPath\\myFile.htm");
            Process.Start("IExplore.exe","C:\\myPath\\myFile.asp");
        }

        /// <summary>
        /// Uses the processstartinfo class to start new processes,both in a minimized 
        /// mode.
        /// </summary>
        public void OpenWithStartInfo()
        {

            processstartinfo startInfo = new processstartinfo("IExplore.exe");
            startInfo.WindowStyle = ProcessWindowStyle.Minimized;

            Process.Start(startInfo);

            startInfo.Arguments = "www.northwindTraders.com";

            Process.Start(startInfo);

        }

        public static void Main()
        {
                    // Get the path that stores favorite links.
                    string myFavoritesPath = 
                    Environment.GetFolderPath(Environment.SpecialFolder.Favorites);

                    MyProcess myProcess = new MyProcess();

            myProcess.OpenApplication(myFavoritesPath);
            myProcess.OpenWithArguments();
            myProcess.OpenWithStartInfo();

               }    
    }
}

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些