在PHP上使用.NET DLL

时间:2013-07-06 10:04:20

标签: php .net com

我正在尝试如何在php上使用我的.net编码的dll函数。我一直在努力研究几个小时,仍然无法让它发挥作用。 PHP版本是5.4.4

错误讯息:
致命错误:未捕获异常'com_exception',消息'无法创建COM对象`php4winbook.examples':C:\ xampp \ htdocs \ testdll \ index.php中的语法无效:13堆栈跟踪:#0 C:\ xampp \ htdocs \ testdll \ index.php(13):com-> com('php4winbook.exa ...')在第13行的C:\ xampp \ htdocs \ testdll \ index.php中抛出#1 {main}

我尝试了什么:

http://www.peachpit.com/articles/article.aspx?p=27291 http://geekswithblogs.net/tkokke/archive/2009/04/24/how-to-use-.net-assemblies-in-php.aspx

到目前为止我找到的最佳资源......

我的代码:

<?php
$test = new COM("php4winbook.examples");
$hellmes = $test->showname("Andrew");
echo $hellmes;
?>

.net dll代码,只是一个简单的hello世界。 “使程序集COM-Visible”选项检查并使用密钥签名。

codes

添加到程序集中 enter image description here

但是我在C:/ windows / assembly文件夹中找不到示例。

1 个答案:

答案 0 :(得分:0)

在COM类中使用它之前,需要在Windows中注册DLL。