C# 如何通过wp7上的c单击网站上的按钮
我需要点击网站上的一个按钮。html中的按钮: wp7 webBrowser不支持webBrowser.Document,因此无法使用C# 如何通过wp7上的c单击网站上的按钮,c#,html,windows-phone-7,C#,Html,Windows Phone 7,我需要点击网站上的一个按钮。html中的按钮: wp7 webBrowser不支持webBrowser.Document,因此无法使用 foreach(HTMLElement html in webBrowser.Document.GetElementByTagName("input")) { if(html.GetAttribute("value) == "Войти") html.InvokeMember("submit"); } 另外,按钮没有id或标记,因此我不能使用getElem
foreach(HTMLElement html in webBrowser.Document.GetElementByTagName("input"))
{
if(html.GetAttribute("value) == "Войти")
html.InvokeMember("submit");
}
另外,按钮没有id或标记,因此我不能使用getElementsById或getElementsByTag如果您使用Javascript填充字段,只需以相同的方式提交表单:
wb1.InvokeScript("eval", "document.forms[0].submit();");
在HTML5 Windows Phone应用程序中,浏览器的默认顺序为。导航。。。然后Browser.isscript enabled=true;不起作用。您需要启用Browser.isscript=true;在导航呼叫之前。您需要更具体地说明您需要做什么。你需要提交表格吗?针对服务器?我有一个url,我需要单击一个按钮,点击带有电子邮件的文本框,然后通过wb1.InvokeScripteval,string.Formatdocument.getElementsByName'email'[0]。值='{0}',Login.Text;我试过了,但它引发了异常,发生了未知错误。错误:80020101.Works,但我尝试了相同的代码并出现异常。谢谢/