Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends
I am working on a small windows application, it is like a web browser applicaion, i can read website (fore instance "www.facebook.com) in application,

now i want to put text from my text boxes to the website's text boxes. plx help

i am going to upload a sample application which explains , kindly update it if any one can do it. (facebook is just an example website..)

download VS project file to edit

view desired output
Posted
Updated 2-Jan-13 9:16am
v2
Comments
DinoRondelly 2-Jan-13 15:18pm    
Where are you stuck?
Have you tried google?
www.google.com
Member 8973214 2-Jan-13 15:24pm    
here i have just read the page,
now i want to put text from textbox (created by me) to facebook textboxes. as shown in the desired output image..
Zoltán Zörgő 2-Jan-13 15:20pm    
I understood what you asked for, but I would like to know why? There are ways to automate a browser, or to embed a browser control in your application. But in many cases there is no need to, it is probably, that you should only simulate the http level behavior of the browser.
Member 8973214 2-Jan-13 15:30pm    
I dont know much about webbrowser class and http classes dear.
I just want to do this like automate ( like to save time). facebook is just example here, and i dont want to do this for any misuse etc.
if you can tell me any other website which fulfills this technique then it is also fine for me.
Sergey Alexandrovich Kryukov 2-Jan-13 15:32pm    
To my understanding, OP is already embedding an instance of the control WebBrowser...
@Member 8973214: is that so?
—SA

It really depend on the complexity of the automation. Putting something on a webpage makes no sense, you either send something to the server, or just draw on an image :). Well, the exact assignment specification could be interesting...

But you have several approaches, some articles and samples to read:
1) Use WebBrowser control, see:
http://www.codeproject.com/Articles/5452/Microsoft-Web-Browser-Automation-using-C
http://www.codeproject.com/Articles/18935/The-most-complete-C-Webbrowser-wrapper-control
2) Automate the Internet Explorer itself:
http://harness.codeplex.com/.
If you have not been told to use WebBrowser control, use this one!
3) If you don't need to have a browser at all, use WebClient, see:
http://www.dotnetperls.com/webclient
http://technet.rapaport.com/Info/LotUpload/SampleCode/Full_Example.aspx

But first of all, you should get to know the http protocol. It is a complex one, but the Wikipedia article is a really good starting point.
 
Share this answer
 
Comments
Member 8973214 2-Jan-13 16:08pm    
thanks alot Zoltan, for more references these will help me.:)
consider you have your textbox name txtlogin, your webbrowser control name webBrowser1 and the website have the textbox have the name txtEmailAddress
you use the following code

C#
webBrowser1.Document.GetElementById("txtEmailAddress").SetAttribute("value", txtlogin.Text);

To use the above code, you will be required to handle the DocumentCompleted event of webbrowser control
 
Share this answer
 
Comments
Member 8973214 2-Jan-13 16:07pm    
Hasham thanks for simple solution. I am Adil.:)
Sergey Alexandrovich Kryukov 2-Jan-13 16:11pm    
I voted 5 for this correct solution, advised OP to do the same.
—SA
[no name] 2-Jan-13 16:12pm    
welcome Adil :)
[no name] 2-Jan-13 21:12pm    
thanks Sergey :) for upvoting and giving the right advice to adil :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900