2

I recently got a project which require communication between php and .Net websites.

The developer form php didnt provide much doc about their code, only a client site library and a small piece of sample code.

// initialize the form parameters from the data provided in the url
$paramDataLen = (int) $_GET['paramdatalen'];
$paramData = base64_decode($_GET['paramdata']);
$paramData = gzuncompress($paramData, $paramDataLen);
$paramArray = unserialize($paramData);

How can i convert code above into C# and use in .NET?

I saw post of this How to unserialize PHP Serialized array/variable/class and return suitable object in C#, however since i have no php experience before, would be good if some one can point me a right direction to do this, whith few more details about how a .net guy dealing with php

I am finding a hard time in converting php code into C# there is another function which i am scraching my head.

mcrypt_decrypt(MCRYPT_BLOWFISH, $config['DATAAPISECRETKEY'], $result, MCRYPT_MODE_CBC, $encryptedData['iv']);

is there any equivalent code/lib available in c#?

3
  • You find all PHP functions documented in the PHP manual: php.net/docs Commented Nov 18, 2011 at 0:29
  • I end up using stackoverflow.com/questions/1914585/…, and it really worked after a few tweeks. Commented Nov 23, 2011 at 4:58
  • D.J. would be cool if you leave some notes in form of an answer how you tweaked / solved it, so you have documented this and others can find it. Commented Nov 23, 2011 at 8:20

1 Answer 1

0

You can transport your object as json.

To facilitate, use Json.NET library.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the answer, sending Json out no problem. however since we have no control of the php code neither development. the difficulties for now is how can i consume data from php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.