使用PHP调用.Net方法 [英] Calling .Net Method using PHP

查看:36
本文介绍了使用PHP调用.Net方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我想通过调度程序调用.Net方法.
Web主机提供的此调度程序可以运行php脚本.

因此,现在,我需要每天在00:00调用属于名称空间MyNamespace的类MyClass的.Net方法MyMethod().
如果是从计划由调度程序运行的php脚本中调用的话,这是可能的.

我添加了如下的php脚本来调用该方法.但是看不到任何结果.
请检查是否正确.并指出错误.

Hello everyone!

I want to call a .Net method through a scheduler.
This scheduler provided by the web host can run php scripts.

So now, I need to call the .Net method MyMethod() of Class MyClass belonging to namespace MyNamespace everyday at 00:00 hrs.

This can be possible if it is called from a php script scheduled to be run by the scheduler.

I have added a php script as follows to call the method. But cant see any result.
Please check if correct. And point out the mistakes.

<?php

$Obj = new COM ('MyNamespace.MyClass');
$Obj->MyMethod();

?>



请帮忙.



Please help.

推荐答案

Obj = COM( MyNamespace.MyClass');
Obj = new COM ('MyNamespace.MyClass');


Obj-> MyMethod(); ?>
Obj->MyMethod(); ?>



请帮忙.



Please help.


我不确定问题到底是什么,但是您可以根据以下指南检查已完成的操作:

http://www.peachpit.com/articles/article.aspx?p=27291 [ ^ ]

失败的话,您可能还想看看:

http://www.php-compiler.net/doku.php [ http://www.leeholmes.com/blog/2006 /10/27/load-a-custom-dll-from-powershell/ [
I''m not exactly sure what the issue is, but you can check what you''ve done against the following guide:

http://www.peachpit.com/articles/article.aspx?p=27291[^]

Failing that, you might also want to take a look at:

http://www.php-compiler.net/doku.php[^]

You create the key file on your development machine and sign the project with it. You''d have to ask your web host if you can deploy something to the GAC - they might be iffy with this, but maybe there is another solution - if you need to call a .net method from a scheduler, could you not do this with powershell?

http://www.leeholmes.com/blog/2006/10/27/load-a-custom-dll-from-powershell/[^]


这篇关于使用PHP调用.Net方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆