如何在已发布的 .Net 站点上包含 COM 组件?
如何在已发布的 .Net 站点上包含 COM 组件?
How to include COM components on a published .Net site?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在已发布的 .Net 站点上包含 COM 组件?
How to include COM components on a published .Net site?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
最后我成功解决了这个问题:
要在您发布的站点上包含COM组件:
注意:请记住,如果您在 Windows 2003 Server 上运行,则必须使用应用程序池标识作为帐户,而不是 ASPNET 帐户。
• 转至开始-运行菜单项。
• 输入“DCOMCNFG”并按回车键。
• 这应该加载“组件服务”MMC(您也可以从“管理工具 - 组件服务”加载)
• 展开“组件服务”
• 展开“计算机”
• 展开“我的电脑”
• 选择“DCOM 配置”项
• 选择“Microsoft Excel 应用程序”项目
• 右键单击并选择“属性”
• 选择“安全”选项卡
• 在“启动和激活权限”下选择“自定义”选项
• 单击“编辑”按钮
• 单击“添加”按钮添加一个。将新帐户添加到列表中
• 在显示的对话框中单击“位置”按钮(这是因为默认情况下将选择您的域,并且我们需要本地帐户)
• 单击“确定”按钮
• 在显示的对话框中输入“ASPNET”。 “作为 Windows XP 上的帐户名称(确保位置设置为 IIS 所在计算机的名称),或者如果您在 Windows 2003 Server 上运行,则必须输入应用程序池默认运行的帐户”网络服务”
注意:在 Windows XP 上更快的方法是仅输入计算机名称和帐户
所以在我的例子中,这将是: ccrowe\ASPNET
• 单击“确定”按钮
• 现在确保为“ASP.NET 计算机帐户”或作为应用程序池标识的帐户(默认为网络服务)选择以下选项
o本地启动:允许
o 远程启动:[空白]
o 本地激活:允许
o 远程激活:[空白]
• 单击确定按钮并再次测试您的 Web 应用程序,它应该可以正常工作。
Finally i succeeded to solve the issue :
To include the COM component on your published site :
Note: Remember if you are running on Windows 2003 Server you must use the application pool identity as the account and not the ASPNET account.
• Go to the Start-Run menu item.
• Type in "DCOMCNFG" and hit enter.
• This should load the "Component Services" MMC (you can also load from Administrative Tools - Component Services"
• Expand "Component Services"
• Expand "Computers"
• Expand "My Computer"
• Select the "DCOM Config" item
• Select the "Microsoft Excel Application" item.
• Right click and select Properties
• Select the Security Tab
• Under "Launch and Activation Permissions" select the "Customize" option.
• Click the "Edit" button
• Click the "Add" button to add a new account to the list.
• On the dialog that is displayed click the Locations button(this is because by default your domain will be selected and we need a local account)
• Click the OK button
• On the dialog that is displayed enter "ASPNET" as the account name (make sure location is set to the name of the computer that IIS is on) on Windows XP or if you are running on Windows 2003 Server you must enter the account that the Application Pool is running as, by default "Network Service"
Note: A quicker way on Windows XP is to just enter the computer name and the account
so in my case that would be: ccrowe\ASPNET
• Click the OK button
• Now make sure you select the following options for the "ASP.NET Machine Account" or the account that is the application pool identity ( by default Network Service)
o Local Launch : Allow
o Remote Launch : [blank]
o Local Activation : Allow
o Remote Activation : [blank]
• Click the OK button and test your web application again and it should work fine.
我可以澄清一下吗? 听起来您想使用嵌入在 html 中的客户端 ActiveX 控件(通过
这不是一个非常安全的方法; 许多浏览器/平台根本无法以这种方式工作。 如果您知道您的客户端是 IE/Windows,那么您也许可以在 cab 中签署 ocx,并标有安全脚本/安全初始化标志。 但是 - 不建议这样做。
如果您想要丰富的客户端体验,请考虑 Silverlight,或者如果您需要对扫描仪等内容进行更丰富的访问,请考虑使用 ClickOnce 部署的智能客户端。
如果您指的是服务器端,那么您可能需要在服务器上安装组件。 免注册表 COM可能可以工作,但配置起来并不容易。 如果您不拥有服务器(即它是为您托管的),那么也许 COM 并不是首先要选择的方法......
Can I clarify? It sounds like you want to use client-side activex controls embedded in the html (via
<object/>
). Is that correct?This isn't a very safe approach; many browsers / platfroms simply won't work this way. If you know your client is IE/windows, then you can perhaps sign the ocx in a cab, marked with the safe-for-scripting / safe-for-initialization flags. BUT - this is not recommended.
If you want a rich client-side experience, consider Silverlight, or a ClickOnce-deployed smart-client if you need richer access to things like scanners etc.
If you mean server-side, then you probably need to install the components on the server. Registry-free COM might work, but isn't easy to configure. If you don't own the server (i.e. it is hosted for you), then perhaps COM isn't the way to go in the first place...