Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从PHP代码到C#的示例_C#_Php - Fatal编程技术网

从PHP代码到C#的示例

从PHP代码到C#的示例,c#,php,C#,Php,我有以下PHP代码&我不知道如何转换它,因为我不熟悉PHP 我迷路了,似乎不知道这里到底发生了什么。这只是我必须使用的php代码的一部分&转换为c#for asp.net Any help in this regard is apprecaited if ($this->can_init()) { $preload='<iframe style="width:1px;height:1px;visibility:hidden;display:none;" src="https

我有以下PHP代码&我不知道如何转换它,因为我不熟悉PHP

我迷路了,似乎不知道这里到底发生了什么。这只是我必须使用的php代码的一部分&转换为c#for asp.net

Any help in this regard is apprecaited

if ($this->can_init()) {
    $preload='<iframe style="width:1px;height:1px;visibility:hidden;display:none;" src="https://secure.telrcdn.com/preload.html"></iframe>';
    $this->enabled          = $this->get_config_option('enabled');
    $this->title            = $this->get_config_option('title');
    $this->description      = $this->get_config_option('description').$preload;
    $this->store_id         = $this->get_config_option('store_id');
    $this->store_secret     = $this->get_config_option('store_secret');
    $this->testmode         = $this->get_config_option('testmode');
    $this->debug            = $this->get_config_option('debug');
    $this->order_status     = $this->get_config_option('order_status');
    $this->cart_desc        = $this->get_config_option('cart_desc');
    $this->form_submission_method   = true;
    $this->api_endpoint = 'https://secure.telr.com/gateway/order.json';
    // Actions
    add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this, 'process_admin_options'));
    add_action( 'woocommerce_thankyou', array($this, 'update_order_status'));
} else {
    $this->enabled = false;
}
我们非常感谢您在这方面提供的任何帮助
如果($this->can_init()){
$preload='';
$this->enabled=$this->get_config_选项('enabled');
$this->title=$this->get_config_选项('title');
$this->description=$this->get_config_选项('description')。$preload;
$this->store_id=$this->get_config_选项('store_id');
$this->store_secret=$this->get_config_选项('store_secret');
$this->testmode=$this->get_config_选项('testmode');
$this->debug=$this->get_config_选项('debug');
$this->order_status=$this->get_config_选项(“order_status”);
$this->cart\u desc=$this->get\u config\u选项('cart\u desc');
$this->form\u submission\u method=true;
$this->api\uhttps://secure.telr.com/gateway/order.json';
//行动
添加操作($this->id,数组($this,'process\u admin\u options');
添加动作('woocommerce'u thankyou',数组('this,'update\u order\u status');
}否则{
$this->enabled=false;
}

页面的完整代码在这里

我试图将上述代码重写为ASP C。 这相当于您的PHP

<%
Dim gv_this, gv_preload

If gv_this->can_init() then
gv_preload = "<iframe style=""width:1px;height:1px;visibility:hidden;display:none;"" src=""https://secure.telrcdn.com/preload.html""></iframe>'
$this->enabled           = $this->get_config_option('enabled')
$this->title             = $this->get_config_option('title')
$this->description       = $this->get_config_option("description').gv_preload
gv_this->store_id          = gv_this->get_config_option('store_id')
gv_this->store_secret      = gv_this->get_config_option("store_secret')
$this->testmode          = $this->get_config_option('testmode')
$this->debug             = $this->get_config_option('debug')
$this->order_status      = $this->get_config_option("order_status')
gv_this->cart_desc         = gv_this->get_config_option('cart_desc')
gv_this->form_submission_method    = true
gv_this->api_endpoint  = "https://secure.telr.com/gateway/order.json"
' Actions
add_action('woocommerce_update_options_payment_gateways_'.gv_this->id, array(gv_this, 'process_admin_options'));
 add_action('woocommerce_thankyou',Array ( gv_this, "update_order_status" )
;Else
gv_this->enabled  = false
End If

%>
can_init()那么
gv_预加载=“”
$this->enabled=$this->get\u config\u选项(“enabled”)
$this->title=$this->get\u config\u选项(“title”)
$this->description=$this->get\u config\u选项(“description”).gv\u预加载
gv\u this->store\u id=gv\u this->get\u config\u选项(“store\u id”)
gv\u this->store\u secret=gv\u this->get\u config\u选项(“store\u secret”)
$this->testmode=$this->get\u config\u选项('testmode'))
$this->debug=$this->get\u config\u选项(“debug”)
$this->order\u status=$this->get\u config\u选项(“order\u status”)
gv_this->cart_desc=gv_this->get_config_选项('cart_desc')
gv\u此->表单提交\u方法=真
gv_此->api_端点=”https://secure.telr.com/gateway/order.json"
"行动",
添加操作('woocmerce\u update\u options\u payment\u gateways'.gv\u this->id,数组(gv\u this,'process\u admin\u options');
添加动作('woocommerce\u thankyou',数组(gv\u this,“更新订单状态”)
其他的
gv_此->已启用=错误
如果结束
%>
希望这对你有帮助