JavaScript 调用 COM 100分
有以下一段代码,
在html中声明如下:
Html : <object type="xxxxxxx" id="plugin/>
Javascript 调用如下:
var plugin = document.getElementById('plugin');
var macAddress = jingangPlugin.macAddress;
我采用.net编写了下COM组件,调试时,发现DLL已经被浏览器加载,但是,javascript调用的输出结果为undefined,
C#代码:
[Guid("4E340314-12DF-4FCF-8949-F4A4DD038F03")]
public interface SecurityPluginInterface
{
[DispId(1)]
string macAddress { get; set; }
}
[Guid("809DE201-7057-4D15-ADE7-9FEBE46FA7CC"), ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(xxxxxxxxxxxx))]
public class SecurityPlugin : SecurityPluginInterface
{
public string macAddress
{
get
{
return "B8-97-5A-31-4A-5D";
}
set
{
}
}