1

私はPHPでしかコーディングしておらず、プロジェクトには新しい構文を学ぶ時間がないことを雇用主がよく知っているにもかかわらず、ASP.NETのみをサポートするデータベース会社との協力を余儀なくされています。

ドキュメントは乏しく、地面に薄い意味があります。誰かがこのスクリプトで起こっていることを翻訳するのを手伝ってくれるので、PHPでそれを行うことを考えることができます

<%
 QES.ContentServer cs = new QES.ContentServer();
 string state = "";
 state = Request.Url.AbsoluteUri.ToString();
 Response.Write(cs.GetXhtml(state));
%>
4

3 に答える 3

1
QES.ContentServer cs = new QES.ContentServer();

コードはクラスメソッドをインスタンス化しますContentServer()

string state = "";

タイプ var の状態を文字列として明示する

state = Request.Url.AbsoluteUri.ToString();

ここで REQUEST URI を (php のように) パスを取得し、それを 1 行の文字列に変換して、前述の文字列 stette var に入れます。

Response.Write(cs.GetXhtml(state));

ここでは、ページを更新せずにメッセージを返します (ajax)。

于 2011-01-31T16:33:17.513 に答える
0

The Request object wraps a bunch of information regarding the request from the client i.e. Browser capabilities, form or querystring parameters, cookies etc. In this case it is being used to retrieve the absolute URI using Request.Url.AbsoluteUri.ToString(). This will be the full request path including domain, path, querystring values.
The Response object wraps the response stream sent from the server back to the client. In this case it is being used to write the return of the cs.GetXhtml(state) call to the client as part of the body of the response.
QES.ContentServer appears to be a third party class and is not part of the standard .NET framework so you would have to get access to the specific API documention to find out what is for and what the GetXhtml method does exactly.

So, in a nutshell, this script is taking the full URI of the request from the client and returning the output from the GetXhtml back in the response.

于 2011-01-31T16:44:35.173 に答える
0

PHP では次のようになります。

<?php
     $cs = new QES_ContentServer(); //Not a real php class, but doesn't look like a native ASP.NET class either, still, it's a class instantiation, little Google shows it's a class for Qwam E-Content Server.
     $state = "";  //Superfluous in PHP, don't need to define variables before use except in certain logic related circumstances, of course, the ASP.NET could have been done in one line like "string state = Request.Url.AbsoluteUri.ToString();"
     $state = $_SERVER['REQUEST_URI'];  //REQUEST_URI actually isn't the best, but it's pretty close.  Request.Url.AbsoluteUri is the absolute uri used to call the page. REQUEST_URI would return something like /index.php while Request.Url.AbsoluteUri would give http://www.domain.com/index.php
     //$state = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; or something similar might be better in this case given the above
     echo $cs->GetXhtml($state);  //GetXhtml would be a method of QES.ContentServer, Response.Write is like echo or print.
?>
于 2011-01-31T17:28:36.717 に答える