There is some url (say url1) which is blocked till some unknown time. Currently, when you request for url1 you're redirected to url2 (Though in fiddler I get a 200 status - why ?)
When url1 will be available - the few first people who will fill the a web-fom and submit it can buy a really nice product in a disccounted price.
i want to write a c# application which will try to access url1 in a loop. After it will enter url1 I want it to fill a known in advance form and select some drop-down list and submit my request.
I have started with:
static void Main(string[] args)
{
string url = "https://url1";
WebRequest request = HttpWebRequest.Create(url);
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string urlText = reader.ReadToEnd();
}
But I'm not sure how to:
1. check the response's url (I thought to check for 302, but filddler show 200. can I see status code in this StreamReader reader
?)
Given this form example, how can I fill it automatically ?
<td style="width: 100px;"> *First name: </td> <td> <input name="ctl00$ctl00$Content$Main$OrderNameFirst" type="text" id="Content_Main_OrderNameFirst" style="width:150px;" /> <span id="Content_Main_RequiredFieldValidator9" class="textValidator" style="display:none;">שדה חובה</span> </td> <td style="vertical-align: top; padding-right: 100px;"> <input type="image" name="ctl00$ctl00$Content$Main$ImageButton1" id="Content_Main_ImageButton1" class="image" src="Images/buttonSubmitPaypal.png" onclick="javascript: return SubmitPaypal(this);" style="cursor:pointer;" /> </td> </tr> </td> </tr> <tr> <td> *Type: </td> <td colspan="2"> <select name="ctl00$ctl00$Content$Main$OrderCreditType" id="Content_Main_OrderCreditType"> <option value="Visa">A</option> <option value="IsraCard">B</option> <option value="MasterCard">C</option>