0

I need to write a console app to open an instance of Internet Explorer. That part is simple.

But I am having a hard time finding out a way to do so with some command line arguments.

Specifically, I need to open IE with the -noframemerging option from a console app.

Any ideas or pointers?

Thanks in advance for any replies.

P.S. If any one knows a way to fire up other browsers in a new Session, I am open to those answers/responses as well.

Just to clarify, I need to open IE (or other browsers as a bonus) in a "New Session".

4

2 回答 2

1

怎么样

//system.diagnostics
ProcessStartInfo startInfo = new ProcessStartInfo
{
    FileName = "IEXPLORE.EXE",
    Arguments = "-noframemerging http://www.google.com"
};
Process.Start(startInfo);
于 2013-08-08T14:58:03.170 回答
1

到目前为止,这是我最终得到的结果(谢谢亚历克斯!!):

Dim url As String = "http://www.mysite.com"
Dim cmdLineOptions As String = "-noframemerging"
Dim args As String = String.Format("{0} {1}", cmdLineOptions, url)

Dim startInfo As New ProcessStartInfo() With {
    .FileName = "IEXPLORE.EXE",
    .Arguments = args
}

Process.Start(startInfo)

只需要知道如何控制除上述之外的一些IE选项(没有菜单,没有工具栏等),我不知道是否可以使用“Process”或“ProcessStartInfo”对象来完成。

于 2013-08-08T15:52:39.657 回答