how to post and retrieve data on different sites using c#
<p>i am trying to post on different websites using c#. I am doing it through a web Browser( the one already in .Net). The code i have done so far is below, in this i am successfully opening facebook and when i click on <code>button_2</code> it automatically fills the login form and i am successfully logged in then. This means i can do it for other sites as well by doing a little changes. </p>

<p>Now the problem here is i want to post some data to different sites, like a link or something, and when i am logged in successfully like in did in the code below what lets say a page opens and in that page i have to fill some data or that link the fields they ask. How to do that to proceed further to fill other form fields? And when i have done that i want to save that final result from that site to a text file?</p>

<p>Kindly tell me how to do that? Or any useful links.
Regards.</p>

<pre><code>    private void button1_Click(object sender, EventArgs e)
    {

        webBrowserCtl.Navigate("https://login.facebook.com/login.php?login_attempt=1");
        webBrowserCtl.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

    }
    void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        string s = webBrowser1.DocumentText;
       // btnLogin.Enabled = true;
    }

    private void button2_Click(object sender, EventArgs e)
    {
        HtmlElement ele = webBrowserCtl.Document.GetElementById("email");
        if (ele != null)
            ele.InnerText = "email here";

        ele = webBrowserCtl.Document.GetElementById("pass");
        if (ele != null)
            ele.InnerText = "password here";

        ele = webBrowserCtl.Document.GetElementById("Login");
        if (ele != null)
            ele.InvokeMember("click");
    }
</code></pre>
