C# ActiveX不';我不能使用Visual Studio
您好,我在C#.net中创建了一个ActiveX控件,并在html页面中使用它 HTML代码是:C# ActiveX不';我不能使用Visual Studio,c#,asp.net,activex,C#,Asp.net,Activex,您好,我在C#.net中创建了一个ActiveX控件,并在html页面中使用它 HTML代码是: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <ti
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<OBJECT id="DemoActiveX" classid="clsid:14CBF038-4D43-457e-A5D2-CBED641218C5" codebase="DemoCSharpActiveXNew.cab">
</OBJECT>
<script type="text/javascript">
var obj = document.DemoActiveX;
alert(obj.AddToIEList());
</script>
</body>
</html>
方法,但当我从Visual Studio运行它时,它会安装dll(打包在“DemoCSharpActiveXNew.cab”中),但会抛出一个java脚本错误,说明:
Object doesn't support property or method
为什么会这样?有什么想法吗
更新:
现在我根据@wakqasahmed提供的链接更新了.inf文件,如下所示:
当我在本地主机上运行网页时,它会安装activex控件,但出现相同的错误
Object doesn't support property or method
甚至在安装activex之后也会出现 您的inf文件似乎不正确
opening file from file system is different from opening it through localhost
请查看此链接以供参考:
您正在使用哪个浏览器版本进行测试?在这两种情况下。我用IE 8.0测试它。我根据您提供的参考使用此设置,但不幸的是,它不起作用。我确信我在这里遗漏了一些东西,但就是想不出来[version]signature=“$CHICAGO$”AdvancedINF=2.0[Add.Code]setup.exe=setup.exe[setup.exe]file-win32-x86=thiscab clsid={14CBF038-4D43-457e-A5D2-CBED641218C5}FileVersion=1,0,0[setup Hooks]RunSetup=RunSetup[RunSetup]run=msiexec.exe/package““%EXTRACT_DIR%\DemoCSharpActiveXSetup.msi”“”/qn我包含了.msi而不是setup.exe,因为它给出了一些不同的问题。
opening file from file system is different from opening it through localhost