gpt4 book ai didi

asp.net - 将 System.windows.Forms 引用添加到 asp.net 网站

转载 作者:行者123 更新时间:2023-12-01 05:31:36 25 4
gpt4 key购买 nike

我有一个 asp.net 应用程序,我在其中使用 System.Windows.Forms 命名空间引用来使用 Web 浏览器控件。该应用程序在本地系统上运行良好,但在托管后显示错误。
我如何嵌入 dll 以在 Web 应用程序中使用。

最佳答案

回答一个 3 1/2 岁的问题很奇怪......

I. 在您的 web.config 中,添加对 Windows.Forms 的引用

<system.web>
<compilation>
<assemblies>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<system.web>

这仅在引用的 DLL 在 GAC 中时才有效。如果不是:
  • 创建 /Bin网站根目录中的文件夹。
  • 在那里复制你的 DLL。
  • 不是 在 web.config 中添加引用。

  • 二、在您的模块/类中,导入 Windows.Forms (VB: Imports/C#: using)
    Imports System.Windows.Forms

    您现在可以使用 Web 浏览器控件。不过,这有点棘手。

    可能的用途包括:生成截图、AJAX 爬取(#! >> _escaped_fragment_)等

    关于asp.net - 将 System.windows.Forms 引用添加到 asp.net 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10850495/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com