Mshtml filling form and posting a message
i have succed in making auto login twitter.com trying post tweet has pop window. here code please guide me how that?
htmlelementcollection statuscollection = webbrowser1.document.getelementsbytagname("textarea");
htmldocument htmldocumentobj;
htmldocumentobj = (htmldocument)webbrowser1.document;
foreach (htmlelement txtarea in statuscollection)
{
htmlelement txt;
if (txtarea.getattribute("type").equals("textarea"))
{
txt = txtarea;
}
htmlanchorelement s = null;
if (txtarea.getattribute("type").equals("textarea"))
{
txtarea.invokemember("click");
txtarea.setattribute("value", "new tweet");
}
}
htmlelementcollection statuscollection = webbrowser1.document.getelementsbytagname("textarea");
htmldocument htmldocumentobj;
htmldocumentobj = (htmldocument)webbrowser1.document;
foreach (htmlelement txtarea in statuscollection)
{
htmlelement txt;
if (txtarea.getattribute("type").equals("textarea"))
{
txt = txtarea;
}
htmlanchorelement s = null;
if (txtarea.getattribute("type").equals("textarea"))
{
txtarea.invokemember("click");
txtarea.setattribute("value", "new tweet");
}
}
asia
hi mr.choudhry,
welcome msdn forum.
you can try sample below.
webbrowser1.document.getelementbyid("global-new-tweet-button").invokemember("click"); htmlelementcollection statuscollection = webbrowser1.document.getelementsbytagname("textarea"); htmldocument htmldocumentobj; htmldocumentobj = (htmldocument)webbrowser1.document; foreach (htmlelement txtarea in statuscollection) { if (txtarea.getattribute("type").equals("textarea")) { txtarea.invokemember("click"); txtarea.setattribute("value", "new tweet2"); } } htmlelementcollection col = webbrowser1.document.getelementsbytagname("a"); foreach (htmlelement el in col) { if (el.innertext == "tweet") { el.invokemember("click"); } }
have nice day.
bob shen [msft]
msdn community support | feedback us
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment