Closed

Convert 20 lines of PHP TO ASP.NET

I need this code to be converted to asp.net :

<?php

$plate = "A71EPD";

$url="[url removed, login to view]";

$cookie = "[url removed, login to view]";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");

curl_setopt($ch, CURLOPT_TIMEOUT, 60);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);

curl_setopt($ch, CURLOPT_REFERER, $url);

$result = curl_exec($ch);

$l_url1 = explode('<form method="post" id="homeForm" action="', $result);

$l_url2 = explode('"><input type="hidden" name="persist_affiliateid" value="" />', $l_url1[1]);

$l_url = $l_url2[0];

$an_id1 = explode('<input type="hidden" name="persist_SubscriberID" value="', $result);

$an_id2 = explode('" />', $an_id1[1]);

$an_id = $an_id2[0];

$token1 = explode('[url removed, login to view]', $l_url);

$token = $token1[1];

$postdata =

"&persist_affiliateid=" . ""

. "&persist_SubscriberID=" . $an_id

. "&persist_ReturnPath=" . "Homepage"

. "&AutoLocateID=" . $token

. "&VRM=" . $plate

. "&DoLogin=" . "Login"

. "&PasswordNotReset=" . "True"

. "&AutocheckNow.y=" . "yes"

. "&Confirmed=" . ""

. "&DoHomepageLogin=" . "Login"

. "&ConfirmVRM=" . ""

. "&ProductId=" . ""

. "&Homepage=" . ""

. "&submit=Login%20into%20Account";

curl_setopt($ch, CURLOPT_URL, $l_url);

curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);

curl_setopt($ch, CURLOPT_POST, 1);

$final_result1 = curl_exec($ch);

$final_result1 = explode('<div class="vehicleDescResult">', $final_result1);

$final_result2 = explode('<br>', $final_result1[1]);

$make = $final_result2[1];

$model = $final_result2[2];

$color = $final_result2[3];

if( $make ){

echo '{"car": { "RegNo": "' . $plate . '", "Make": "' . $make . '", "Model": "' . $model . '", "Color": "' . $color . '" }}';

}

else{

echo '{"car": { "RegNo": "unknown", "Make": "unknown", "Model": "unknown", "Color": "unknown" }}';

}

curl_close($ch);

?>

Skills: .NET, PHP

See more: php color code, car id, php net, rv, post form hidden, windows 2012 https, asp form login, convert php form, php form convert, php post value, form hidden submit, php action form, class convert, php form action, form convert, php value post, form post hidden, net gecko, gecko model, form hidden post value, php post hidden, login net, convert windows windows, convert php net code, convert net php code

About the Employer:
( 3 reviews ) Cluj Napoca, Romania

Project ID: #2459047

9 freelancers are bidding on average $8/hour for this job

shuvrapintu

Hi, Thanks for posting this transparent and simple task. We need to to change the curl syntax and change the parsing method. Please accept to start right away. Estimated time for this rask is : 1 HOUR

$8 USD / hour
(136 Reviews)
6.6
mrnewict

Hi, please check PM!

$8 USD / hour
(30 Reviews)
5.4
gaddas86

Hi, It's easy job - just have to change the curl to the webrequest and fix the parsing. I can do it in ~1 hour as I'm expert in web scraping.

$8 USD / hour
(39 Reviews)
4.7
prakher

can do it now. waiting for acceptance.

$8 USD / hour
(9 Reviews)
4.5
Fitzgeraldz

A warm greeting, I work as a Professional Developer I have 7 years experience I program it so in c, c++, c#, java, vb, matlab, asm, python, AutoLISP, aspx, php, html, dhtml, css, ajax, jquery, mvc, MSSQL, MySQL, Silver More

$8 USD / hour
(13 Reviews)
4.3
krkcare

Hi, We have gone through your requirement. We can do this. We have sent you a private message. Kindly check that. Thanks Shalini

$8 USD / hour
(3 Reviews)
3.6
claretalabs1

We are an IT organization; dealing with Software development since last 4+ years of our existence. We maintain absolute confidentiality. We had worked as result oriented professionals. Our objective is to give 100% More

$5 USD / hour
(0 Reviews)
0.0
hayatk14

I will give you project on time.

$10 USD / hour
(0 Reviews)
0.0
kooshasl

Project should be ready in 1hours after bid accept.

$10 USD / hour
(0 Reviews)
0.0