Hi.
when I navigate this site:
http://bp.olispace.ca/wiki
it is going to: http://bp.olispace.ca/wiki/index.php?title=Main_Page . page
I want to go to http://bp.olispace.ca/wiki/index.php?title=Special:UserLogin&type=signup&returnto=Main_Page register page when I click button1 in my web based application.
how can I add "title=Special:UserLogin&type=signup&returnto=Main_Page" query to webBrowser1 url instead of "title=Main_Page" query when webBrowser on the http://bp.olispace.ca/wiki/index.php?title=Main_Page page.
I think my problem is simple. (go to register page on a wiki site by clicking button1). but I can't solve this problem.
What code should I write in button1 click event
Thanks
Loading
??????? ????????Posted Jul 24, 2015, 9:35 AM
??????? ????????Posted Jul 24, 2015, 9:34 AM
Csharp NinjaPosted Apr 21, 2012, 6:30 PM
foreach (HtmlElement watsupsamhobbs in webBrowser1.Document.All)
{
if (watsupsamhobbs.InnerText == "Log in / create account")
{
watsupsamhobbs.InvokeMember("click");
}
//after 5 seconds
if (watsupsamhobbs.InnerText == "Create an account")
{
watsupsamhobbs.InvokeMember("click");
}
}
Cheers!!
Sam HobbsPosted Apr 20, 2012, 1:20 PM
I think there is more going on here. You know that members do not like to be told rules, right? You have had bad experiences from posting messages requesting members to accept answers. Correct? People thought you were doing it just to get points.
I think members get the wrong impression when I try to explain what they should do. Vulpes does not do that so they favor Vulpes. That is good for the members getting help but it is not good for the forums in general. I think it also helps members to learn how to ask questions more effectively and I try to help them with that but they think I am not helping. Even Mahesh does not understand but I hope he is beginning to understand.
Suthish NairPosted Apr 20, 2012, 9:10 AM
I would not accept Vulpes answer here, will go for Sam's answer only..
webBrowser1.Navigate("http://bp.olispace.ca/wiki/index.php?title=Special:UserLogin&returnto=Main_Page");
Because, Vulpes code increases number of lines and also you only want to redirect to Registration page and already you have the url.
Then why need to find the the index and append the string again instead of directly writing the code...
Sam HobbsPosted Apr 19, 2012, 12:58 PM
Vulpes is spoiling members. It is unlikely there is anyone else in any forum that will help others for free like Vulpes does. That is good except I think it helps the member to learn how to ask questions in a manner that gives other volunteers a chance to help also. Most volunteers willing to help others would make the same requests that I do.
VulpesPosted Apr 19, 2012, 11:26 AM
Csharp NinjaPosted Apr 19, 2012, 11:20 AM
Mahesh ChandPosted Apr 19, 2012, 11:07 AM
Please do not mention a user name in the subjects or forums. That puts pressure on our guys. Just post questions.
Thank you!
Csharp NinjaPosted Apr 19, 2012, 10:54 AM
Sam HobbsPosted Mar 25, 2012, 5:57 PM
What I do when I write code like that is I use a separate project I have for trying things. You can create a console application if you do not have one already. Then use that to determine the details of how to use the IndexOf and Substring Methods for this.
I am sorry that I am not like Vulpes. I think it helps developers more if they do as much as they can. So in my opinion I am not being rude or disrespectful for not providing sample code; in my opinion I am being more respectful because I am confident you are totally capable of doing it.
Csharp NinjaPosted Mar 25, 2012, 4:57 PM
Sam HobbsPosted Mar 25, 2012, 3:48 PM
I will try to describe something that will probably work. I need to do some other work first before I can go into more detail.
Start by navigating to the wiki's home page such as "ttp://bp.olispace.ca/wiki". Then in the document complete event find the "?" in the URL and remove the part of the URL after the "?", then add "title=Special:UserLogin&type=signup&returnto=Main_Page". Then navigate to that.
If you are not using the document complete event, then that might be the main problem. If you do not know how to use the document complete event, then read my article; the one I told you on February 2 to read.
Csharp NinjaPosted Mar 25, 2012, 3:16 PM
Sam HobbsPosted Mar 25, 2012, 3:00 PM
Csharp NinjaPosted Mar 25, 2012, 2:44 PM
I tried a lot of code like:
webBrowser1.Navigate(webBrowser1.Url.ToString() + "/index.php?title=Special:UserLogin&type=signup&returnto=Main_Page");
webBrowser1.Navigate(webBrowser1.Url.ToString() + "?title=Special:UserLogin&type=signup&returnto=Main_Page");
but they doesn't work.
Sam HobbsPosted Mar 25, 2012, 2:18 PM