B
Bit Byte
I have an existing application which consists of a C++ frontend, and a
PHP backend. I am currently contemplating moving from PHP to ASP.Net at
the server side. At the server side, I have code somewhat like this:
<?
// function definitions here ...
$enc_str = base64_decode($_POST['request']);
$xml_str = mcrypt_ecb(MCRYPT_BLOWFISH, ENCRYPTION_KEY, $enc_str,
MCRYPT_DECRYPT);
$xml = simplexml_load_string($xml_str);
if(!is_object($xml))
respond(INVALID_REQUEST);
// Determine requested function and invoke handler
switch($xml->function[0])
{
case FUNCTION_1:
foobar1($xml);
break;
case FUNCTION_2:
foobar2($xml);
break;
default:
respond(INVALID_REQUEST);
}
?>
Basically (for those not familiar with PHP) it means I can call this url
(i.e. php script) with some arguments from my C++ code (POST method),
which then invokes the appropriate function on the server side.
Can I do this using the ASP.Net framework ?. I mean if I have a 'page'
called 'functions.aspx' (for example), could I pass it parameters via
POST (say) and invoke methods in say a "code-behind" C# library ?
I can't actually think of a reason why this cannot be, but I thought I'd
better ask in here first.
A small sample class or C# code (like the PHP code above) showing how I
may do this would be much appreciated
PHP backend. I am currently contemplating moving from PHP to ASP.Net at
the server side. At the server side, I have code somewhat like this:
<?
// function definitions here ...
$enc_str = base64_decode($_POST['request']);
$xml_str = mcrypt_ecb(MCRYPT_BLOWFISH, ENCRYPTION_KEY, $enc_str,
MCRYPT_DECRYPT);
$xml = simplexml_load_string($xml_str);
if(!is_object($xml))
respond(INVALID_REQUEST);
// Determine requested function and invoke handler
switch($xml->function[0])
{
case FUNCTION_1:
foobar1($xml);
break;
case FUNCTION_2:
foobar2($xml);
break;
default:
respond(INVALID_REQUEST);
}
?>
Basically (for those not familiar with PHP) it means I can call this url
(i.e. php script) with some arguments from my C++ code (POST method),
which then invokes the appropriate function on the server side.
Can I do this using the ASP.Net framework ?. I mean if I have a 'page'
called 'functions.aspx' (for example), could I pass it parameters via
POST (say) and invoke methods in say a "code-behind" C# library ?
I can't actually think of a reason why this cannot be, but I thought I'd
better ask in here first.
A small sample class or C# code (like the PHP code above) showing how I
may do this would be much appreciated