作者:平头 | 来源:互联网 | 2018-05-23 21:02
dll{代码...}已经强制签名、已经注册:{代码...}PHP.ini{代码...}index.php{代码...}报错Fatalerror:inD:xampphtdocscomindex.phponline2非常费解,求指点!-_-||
dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace Toledo
{
[ComVisible(true)]
public class Scale
{
public string write()
{
return "hello world!";
}
}
}
已经强制签名、已经注册:
regasm Toledo.dll <回车>
gacutil /I Toledo.dll <回车>
PHP.ini
[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
index.php
write();
echo $s;
报错
Fatal error: in D:\xampp\htdocs\com\index.php on line 2
非常费解,求指点! -_-||
回复内容:
dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace Toledo
{
[ComVisible(true)]
public class Scale
{
public string write()
{
return "hello world!";
}
}
}
已经强制签名、已经注册:
regasm Toledo.dll <回车>
gacutil /I Toledo.dll <回车>
PHP.ini
[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
index.php
write();
echo $s;
报错
Fatal error: in D:\xampp\htdocs\com\index.php on line 2
非常费解,求指点! -_-||
建议封装到WCF中调用
http://www.cnblogs.com/tianbang/archive/2012/05/10/2494147.html