-
Notifications
You must be signed in to change notification settings - Fork 71
/
Program.cs
44 lines (37 loc) · 1.27 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using SHDocVw;
using System;
using System.Threading;
namespace UITest
{
class Program
{
const int navNoReadFromCache = 0x4;
static AutoResetEvent completed = new AutoResetEvent(false);
static void OnDocumentComplete(object pDisp, ref object URL)
{
completed.Set();
}
static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Usage: IEAutomation url [url...]");
Console.WriteLine();
Console.WriteLine("Example: IEAutomation http://bing.com/maps http://bing.com/news");
Environment.Exit(1);
}
InternetExplorer ie = (InternetExplorer)Activator.CreateInstance(Type.GetTypeFromProgID("InternetExplorer.Application"));
ie.Visible = true;
ie.DocumentComplete += OnDocumentComplete;
while (true)
{
foreach (string page in args)
{
ie.Navigate(page, navNoReadFromCache);
completed.WaitOne();
}
}
}
}
}