资源介绍
操作IE窗口
SHDocVw.InternetExplorer ies = new SHDocVw.InternetExplorer();
//DataSet1TableAdapters.userTableAdapter ud = new userTableAdapter();
SHDocVw.WebBrowser wb = new SHDocVw.WebBrowser();
SHDocVw.IShellWindows swc = new SHDocVw.ShellWindowsClass();
mshtml.HTMLInputElementClass input;
foreach (var item in swc)
{
SHDocVw.InternetExplorer objIE = (SHDocVw.InternetExplorer)item;
System.Console.Write(objIE.FullName);
System.Console.Write(objIE.LocationName);
//System.Console.Write(objIE.Document);
System.Console.Write(objIE.Name);
if (objIE.LocationName == "国航飞行安全管理信息系统")
{
// System.Console.Write("----");
mshtml.IHTMLDocument2 ieDoc = (mshtml.IHTMLDocument2)objIE.Document;
foreach (mshtml.IHTMLElement ieElement in ieDoc.all)
{
//if its tag is input and name is q(question)
if (ieElement.tagName.ToUpper().Equals("INPUT"))
{
input = ((mshtml.HTMLInputElementClass)ieElement);
if (input.name == "username")
{
//Response.Write(input.value);
input.value = ""+name+"";
}
if (input.name == "password")
{
// Response.Write(input.value);
input.value = "GHGF20096152";
}
}
}
}
- 上一篇: IE 8 For XP_2003
- 下一篇: vb IE浏览器完全控制