外部で実行中の Web アプリケーションがあり、多くのテキスト ボックスに異なる値を入力する必要があります。
テキストボックスは Flash アプリケーションにあるようです。
しかし、テキストボックスが見つかりません。これまでのところ、ブラウザーとその中のドキュメントを取得できましたが、要素の名前や ID についてはわかりません。それらを特定するには、それらを検索する必要があります。
using SHDocVw;
using mshtml;
private const string AppURL = @"https://Application.html";
static void Main(string[] args)
{
InternetExplorer IE;
if (GetApp(out IE))
{
HTMLDocumentClass Doc = (HTMLDocumentClass)IE.Document;
}
Console.WriteLine("Programa encerrado, aperte qualquer tecla para sair");
Console.ReadKey();
}
private static bool GetApp(out InternetExplorer Result)
{
Result = null;
int AppCount = 0;
ShellWindows Wins = new ShellWindows();
foreach (InternetExplorer IE in Wins)
{
if (IE.LocationURL == AppURL)
{
AppCount++;
Result = IE;
}
}
if (AppCount == 0)
Console.WriteLine("Running App wasn't found");
else if (AppCount > 1)
Console.WriteLine("There is more than one App running");
else
return true;
return false;
}
}