المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Completing a mulit-page webform using WebClient



C# Programming
04-02-2009, 05:31 AM
Hi all,

I've been having a little problem with the WebClient class, and am hoping someone can help.

Here is what I'm currently working with:


string uri = "WebURL";

byte[] postBytes = Encoding.ASCII.GetBytes(postString_Begin);
byte[] postBytes2 = Encoding.ASCII.GetBytes(postString2);

WebClient myClient = new WebClient();
myClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");

byte[] response = myClient.UploadData(uri, postBytes);

string myresponse = Encoding.ASCII.GetString(response);

response = myClient.UploadData(uri2, postBytes2);

Here is where I hit my wall.
After I upload the first queryString, the next step in the process is returned.
The URL does not change, but when I go to post the next section of values, it posts them back to the first page/form part.
Can anyone point me to How I can post my second querystring to the returned page from the first request?

Thanks