antoniobranco Posted June 13, 2012 at 04:14 PM Report Share #462528 Posted June 13, 2012 at 04:14 PM (edited) Boas, ando a fazer uma aplicação pedida pelo meu tio, ele pediu-me para fazer uma aplicação em que eu pudesse preencher os campos de registo de um site e carregar num botão para registar. Já consegui preencher os campos, não consigo é através do botão em c#, carregar no botão em javascript, alguém me poderia dar uma ajuda? Edited June 13, 2012 at 04:15 PM by antoniobranco Link to comment Share on other sites More sharing options...
antoniobranco Posted June 13, 2012 at 04:48 PM Author Report Share #462536 Posted June 13, 2012 at 04:48 PM (edited) ninguém sabe? é um bocado urgente 😕 Edited June 13, 2012 at 05:01 PM by antoniobranco Link to comment Share on other sites More sharing options...
Rechousa Posted June 13, 2012 at 06:17 PM Report Share #462540 Posted June 13, 2012 at 06:17 PM Que tio apressado 😛 Desculpa, mas não percebi nada, explica lá melhor o que queres fazer. Pedro Martins Sharing is Knowledge! http://www.linkedin.com/in/rechousa Link to comment Share on other sites More sharing options...
antoniobranco Posted June 13, 2012 at 06:22 PM Author Report Share #462542 Posted June 13, 2012 at 06:22 PM por exemplo para pesquisar no google, o botão de pesquisa chama um método em javascript, como é que eu em C# chamo esse método com o site aberto no objecto webBrowser? acho que é uma coisa simples de fazer, mas não estou a conseguir chamar a função do site pela linguagem c#. Link to comment Share on other sites More sharing options...
Rechousa Posted June 13, 2012 at 06:45 PM Report Share #462546 Posted June 13, 2012 at 06:45 PM Vê aqui como fazer isso Pedro Martins Sharing is Knowledge! http://www.linkedin.com/in/rechousa Link to comment Share on other sites More sharing options...
antoniobranco Posted June 13, 2012 at 07:22 PM Author Report Share #462555 Posted June 13, 2012 at 07:22 PM já consigo localizar a função, mas por alguma razão continua a não dar.. Link to comment Share on other sites More sharing options...
antoniobranco Posted June 13, 2012 at 07:44 PM Author Report Share #462558 Posted June 13, 2012 at 07:44 PM (edited) HtmlElement el = webBrowser1.Document.GetElementById("the_button"); object obj = el.DomElement; System.Reflection.MethodInfo mi = obj.GetType().GetMethod("theButton()"); mi.Invoke(obj, new object[0]); já tinha pesquisado assim antes mas dá me este erro ao fazer Invoke: "Object reference not set to an instance of an object." Edited June 13, 2012 at 07:45 PM by antoniobranco Link to comment Share on other sites More sharing options...
Rechousa Posted June 13, 2012 at 09:38 PM Report Share #462575 Posted June 13, 2012 at 09:38 PM A tua variável mi é null? Pedro Martins Sharing is Knowledge! http://www.linkedin.com/in/rechousa Link to comment Share on other sites More sharing options...
antoniobranco Posted June 13, 2012 at 09:57 PM Author Report Share #462578 Posted June 13, 2012 at 09:57 PM já consegui depois de várias tentativas 😉 Link to comment Share on other sites More sharing options...
Rechousa Posted June 13, 2012 at 10:45 PM Report Share #462590 Posted June 13, 2012 at 10:45 PM Óptimo! Pedro Martins Sharing is Knowledge! http://www.linkedin.com/in/rechousa Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now