Eddie Shipman
asked on
PHP to C# conversion
I have this PHP code to compute a ticket# based on someone's ID and the current time.
I need a C# version of this. Can anyone help out?
I need a C# version of this. Can anyone help out?
$Cust_ID = "1158341";
$reftime = mktime(0,0,0,12,31,1973);
$preticket = floor((time()-$reftime)/(3600*24*7))*$Cust_ID;
$ticket = 'f' . dechex($Cust_ID) . md5($preticket);
echo $ticket;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks OK, kaufmed but I get these in VS2010:
Error 1 'int' does not contain a definition for 'TotalSeconds'
and no extension method 'TotalSeconds' accepting a first argument of type 'int' could be found
(are you missing a using directive or an assembly reference?)
Error 2 The best overloaded method match for 'System.Convert.ToString(object, System.IFormatProvider)'
has some invalid arguments
Error 3 Argument 2: cannot convert from 'int' to 'System.IFormatProvider'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Self Answered
ASKER
Open in new window