登录 注册
当前位置:主页 > 资源下载 > 9 > .net操作IE窗口下载

.net操作IE窗口下载

  • 更新:2024-12-07 17:38:44
  • 大小:2KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Web开发 - 开发技术
  • 格式:TXT

资源介绍

操作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"; } } } }