SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
ie.DocumentComplete += ie_DocumentComplete;
ie.Navigate("http://www.baidu.com");
ie.Visible = true;
compWait();
mshtml.HTMLDocument doc = ie.Document;
doc.getElementById("kw1").innerText = "hellow world";
doc.getElementById("su1").click();
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
到这一步的时候就会出现异常
你的系统中没有IE,或者你的.net程序集是64bit的,不能调用32bit的shdocvw
asp.net无权访问注册表
不过也不用想解决这个问题了,因为IE的网络层WinInet也不支持服务,所以就算你能加载注册表也没用。
用HttpWebRequest自己写请求吧。