[RESOLVED] How fetch the values using regex in csharp
Hi,
This is my code.
Code:
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<TITLE></TITLE>
</HEAD>
<BODY onload="javascript:document.returnform.submit()">
<FORM action="/mdpaympi/MerchantServer" method="POST" name="returnform">
<INPUT name="version" type="hidden" value="2.0">
<INPUT name="PAN" type="hidden" value="4314229999999913">
<INPUT name="Ecom_Payment_Card_ExpDate_Year" type="hidden" value="13">
<INPUT name="Ecom_Payment_Card_ExpDate_Month" type="hidden" value="01">
<INPUT name="deviceCategory" type="hidden" value="0">
<INPUT name="cardType" type="hidden" value="">
<INPUT name="expiry" type="hidden" value="1301">
<INPUT name="purchAmount" type="hidden" value="1000">
<INPUT name="currency" type="hidden" value="840">
<INPUT name="exponent" type="hidden" value="2">
<INPUT name="description" type="hidden" value="null">
<INPUT name="merchantID" type="hidden" value="1298">
<INPUT name="xid" type="hidden" value="cl6kYo1WDWQDD7PPOwKBxOiyNgc=">
<INPUT name="okUrl" type="hidden" value="https://secureshop-test.firstdata.lv:443/ecomm/ClientHandler">
<INPUT name="failUrl" type="hidden" value="https://secureshop-test.firstdata.lv:443/ecomm/ClientHandler">
<INPUT name="MD" type="hidden" value="">
<INPUT name="digest" type="hidden" value="L6Tvvq6FNqAnhJlQQmqvEiJY2Uk=">
<DIV align="center">
<H3>PAYMENT TRANSACTION PROCESSING ....</H3>
<NOSCRIPT> Please click the submit button below.<BR>
<INPUT name="submit" type="submit" value="Submit">
</NOSCRIPT>
</DIV>
</FORM>
</BODY>
</HTML>
How can I fetch the values of each input from the attached HTML
using regular expression in c#? Hope your's reply.
Re: How fetch the values using regex in csharp
Hello there,
Certainly, using Regular Expression is one approach, however, that would involve a lot of hard work creating the regex. I would recommend that you use the HTML Agility Pack, which you can download from here:
http://htmlagilitypack.codeplex.com/
It does a lot of the heavy lifting that you need to do in order to parse the HTML.
Hope that helps!
Gary