我的桌面上有一個Internet Explorer頁面打開。網頁的名稱是TEST。使用user32.dll中的FindWindow(),我可以在窗口中獲得一個處理程序。在這個頁面中,我有一個名爲Go和I 2的文本框,名爲Name和Surname。我怎樣才能在網頁上寫我的名字和姓氏,然後點擊Go進行編程? THXInternet Explorer頁面上的SendMessage user32dll
1
A
回答
0
我不確定你使用Win32(user32.dll)實際上可能會問什麼,說 如果你試圖與web服務器交互,那麼你可以簡單地使用httprequest和httpresponse類來GET和POST根據需要變量。
HttpWebRequest testRequest = (HttpWebRequest)WebRequest.Create("http://.....");
HttpWebResponse testResponse = (HttpWebResponse)testRequest.GetResponse();
string responseStatus = testResponse.StatusCode.ToString();
testResponse.Close();
http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx
http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx
如果你的字符串進行測試或答辯一套標準的事件,那麼你可能想看看提琴手
http://www.fiddler2.com/fiddler2/
2
正常的方法來更新外國的窗口(WM_SETTEXT
等)榮獲」因爲IE中的表單組件不是股票窗口,而是它們由IE自身呈現。
要操縱它們,您需要通過DOM調用(或使用類似WaitN的東西)。
using mshtml; //.net ref microsoft.mshtml
using SHDocVw; //com ref `microsoft internet controls` + change ref to no embed interop
int HWND = 0x001C0C10; //your IE
foreach(InternetExplorer ie in new ShellWindowsClass()) {
//find the instance
if (ie.HWND == HWND) {
//get doc
HTMLDocument doc = (HTMLDocument)ie.Document;
doc.getElementsByName("name").item(0).value = "bob";
doc.getElementsByName("surname").item(0).value = "smith";
doc.getElementsByName("go").item(0).click();
}
}
相關問題
- 1. Internet Explorer的整個頁面的背景
- 2. 在Internet Explorer中的JSP頁面緩存
- 3. Internet Explorer上不兼容的閃屏頁
- 4. Internet Explorer上的Array.from
- 5. Internet Explorer和Firefox支持@media頁面嗎?
- 6. 使用Internet Explorer阻止查看頁面
- 7. .NET頁面掛在Internet Explorer中
- 8. 在Internet Explorer中顯示某個頁面
- 9. javascript.window.open:open只在Internet Explorer中打開頁面
- 10. 頁面過期 - PHP/CakePHP和Internet Explorer
- 11. Internet Explorer網站顯示空白頁面
- 12. 停止Internet Explorer 8頁面滾動
- 13. Internet Explorer上的可見面板CSS
- 14. Window.Open()被修改的頁面佈局上的Internet Explorer
- 15. Internet Explorer 8的超時太快的頁面上發帖
- 16. Internet Explorer中的JavaScript調試(頁面上的所有腳本)
- 17. 我怎麼能SendMessage函數到Internet Explorer 9 WinAPI的
- 18. 使用Internet Explorer 9時,頁面上不顯示ASP.NET doPostBack功能
- 19. gwt頁面在Internet Explorer中顯示,但不在Chrome上
- 20. 如何在單個頁面上檢測Internet Explorer和重定向
- 21. 背景上的Internet Explorer 7
- 22. Internet Explorer 9上的Foundation 4
- 23. 在Internet Explorer上的Cakephp Favicon
- 24. Internet Explorer上的Flash問題
- 25. 目錄上傳的Internet Explorer
- 26. Internet Explorer上的obj圖標
- 27. 上的Internet Explorer鏈路
- 28. Internet Explorer上的書籤API
- 29. Internet Explorer 11上的XDR
- 30. 的Internet Explorer 8和Internet Explorer 6並排