将PHP代码转换为C#ASP.net [英] Convert PHP code into C# ASP.net
本文介绍了将PHP代码转换为C#ASP.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好b $ b
我只想将PHP代码转换为C#asp.net,下面是PHP代码 -
Hi
I just want to convert PHP code into C# asp.net below is the PHP code-
<?
$databasehost = "localhost";
$databasename = "xxxx";
$databaseusername ="xxxx";
$databasepassword = "xxxx";
$con = mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
$query = file_get_contents("php://input");
$sth = mysql_query($query);
if (mysql_errno()) {
header("HTTP/1.1 500 Internal Server Error");
echo $query.'\n';
echo mysql_error();
}
else
{
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$rows[] = $r;
}
print json_encode($rows);
}
?>
请请尽快解决
Pls rply me ASAP
推荐答案
databasehost = 本地主机跨度>;
databasehost = "localhost";
databasename = XXXX跨度>;
databasename = "xxxx";
databaseusername = XXXX跨度>;
databaseusername ="xxxx";
这篇关于将PHP代码转换为C#ASP.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文