I have some date in my system ( in a text file ). When I position the cursor in a text box of a web page, www.gmail.com-> Username, and press a key in my keyboard, then a list box is load and we can select a value from that list and when we press the enter key, then i need to set the selected text into that text box ( user name in google.com. How can we set that data to a web page control?
Set data to a web pageSet data to a web page
Page 1 of 1
2 Replies - 309 Views - Last Post: 01 April 2010 - 03:39 AM
Replies To: Set data to a web page
#2
Re: Set data to a web page
Posted 31 March 2010 - 11:15 PM
Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
#3 Guest_sabeeshcs*
Re: Set data to a web page
Posted 01 April 2010 - 03:39 AM
PsychoCoder, on 31 March 2010 - 10:15 PM, said:
Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
using namespace System;
using namespace System::Windows;
using namespace System::Windows::Controls;
using namespace System::Net;
using namespace System::IO;
using namespace System::Web;
ref class FirstWindow : Window
{
Canvas^ maincanvas;
TextBox^ textbox;
System::String^ strURL;
System::String^ strResult;
System::String^ strPostData;
System::IO::StreamReader^ sr;
System::IO::StreamWriter^ sw;
System::Net::HttpWebRequest^ wbrq;
System::Net::HttpWebResponse^ wbrs;
public:
FirstWindow(void)
{
Title = "First Avalon App";
Width = 800;
Height = 800;
InitControls();
}
void InitControls(void)
{
strURL = gcnew System::String( "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&ss=1&scc=1<mpl=default<mplcache=2");
strPostData = gcnew System::String("");
strPostData = strPostData->Format("username={0}", "Mark Smith");
wbrq = (System::Net::HttpWebRequest ^)System::Net::WebRequest::Create( strURL->ToString());
//wbrq->Method = "GET";
wbrq->Method = "POST";
wbrq->Referer = "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&ss=1&scc=1<mpl=default<mplcache=2";
wbrq->ContentLength = strPostData->Length;
wbrq->ContentType = "application/x-www-form-urlencoded";
// Post the data
sw = gcnew System::IO::StreamWriter(wbrq->GetRequestStream());
sw->Write(strPostData);
sw->Close();
wbrs = (System::Net::HttpWebResponse ^)wbrq->GetResponse();
sr = gcnew System::IO::StreamReader(wbrs->GetResponseStream());
strResult = sr->ReadToEnd();
sr->Close();
textbox = gcnew TextBox();
textbox->Width = 700;
textbox->Height = 700;
Canvas::SetTop(textbox, 5);
Canvas::SetLeft(textbox, 5);
textbox->Text = strResult->ToString();
maincanvas = gcnew Canvas();
maincanvas->Children->Add(textbox);
Content = maincanvas;
}
};
using this code, we can read the source code of gmail.com and set the name in field "Email". But it does not display in the page. How can I reset the name in field "username" in page gmail.com.
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote






|