Click here to Skip to main content
16,007,277 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
kindly if some one can help me in converting following code of php to c#

PHP
function jvzValid()
{
    $key='Your_JVZIPN_Secret_Key';
    $rcpt=$_REQUEST['cbreceipt'];
    $time=$_REQUEST['time'];
    $item=$_REQUEST['item'];
    $cbpop=$_REQUEST['cbpop'];
 
    $xxpop=sha1("$key|$rcpt|$time|$item");
    $xxpop=strtoupper(substr($xxpop,0,8));
 
    if($cbpop==$xxpop)
        return 1;
    else
        return 0;
}
Posted
Updated 20-Jun-16 11:08am
Comments
Garth J Lancaster 17-Nov-13 5:15am    
to generate a SHA1 hash in C# ... not hard

The issue is your question/code-snippet provides no context on meaning/derivation of $_REQUEST

We could assume its a string dictionary, for example, but I still wouldn't be happy with that alone - what if $_REQUEST['item'] doesn't exist for example ?
BillWoodruff 17-Nov-13 5:28am    
Take a look at Phalanger:

http://phalanger.codeplex.com/

1 solution

Possibly you are concerned about only conversion between those 2, not centered to topic.For that case you can follow Phalanger[^] which allows you to compile PHP code for .Net. Also can follow these which may help you:
How to convert php to C#[^]
Migrating PHP Code To C#[^]
Code converter from php to c# .net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900