.net - 从 PHP 页面调用 .net 函数

标签 .net php com

我在 .net 代码中有这个功能:

public class StringGenerator
{
    public static string GenerateString(string hash)
    {
        return hash.GetHashCode();
    }
}

我希望能够从 PHP 页面调用它。知道怎么做吗?

编辑: 查看 php 文档,http://www.php.net/manual/en/class.dotnet.php ,我认为这是可能的。但我无法编写代码来找到这个 dll,即使是强命名的 dll。 dll 文件与 php 页面位于同一文件夹中。

最佳答案

如果您使用的是 Windows,本文可能对您有所帮助:

PHP and .NET

在另一个平台上,您可以使用类似 Phalanger 的东西通过 PHP 访问 .NET 运行时。

关于.net - 从 PHP 页面调用 .net 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2909946/

相关文章:

c# - 水平滚动条在 DataGridView 上不可见

c# - 如何在 C# 中编写代码来比较日文字符串?

php - 如何在全文 MySQL 搜索中同时匹配 htmlentified 关键字和非 htmlentified 关键字

php - 无法跳转到第 0 行

c++ - 未能释放Direct3D Device "or"对应上下文

c# - 在 C# 中使用 VB6 OCX 生成的事件

.net - 通用 GDI+ 错误

c# - 我可以在同一类的另一个委托(delegate)中访问委托(delegate)吗?

php - 如何使用 union 在两个表中进行搜索?

c++ - IDispatch::Invoke(DISPATCH_PROPERTYGET) 是否会增加返回的 IDispatch 接口(interface)的引用计数?