C#: In what assembly is SHDocVw.WebBrowser_V1 defined?

百般思念 提交于 2019-12-05 10:00:25

问题


It's used on several websites which all seem to assume the reader knows what to do to have this type available, but I have no clue.

Example site, see the first comment: http://blogs.artinsoft.net/mrojas/archive/2008/09/18/newwindow2-events-in-the-c-webbrowsercontrol.aspx


回答1:


It's not an assembly, it's a COM component. Project + Add Reference, Browse tab, select c:\windows\system32\shdocvw.dll. In Windows 7 pick shdocvw.tlb in the same directory instead. This generates the interop library for the COM component with the SHDocVw namespace. WebBrowser_V1 is one of the types you'll get from that.




回答2:


You can get it from the COM component list. The assembly name is "Microsoft Internet Controls".

  1. Right click "References" of your project in Solution Explorer view
  2. Click Add Reference
  3. Go to COM section
  4. Select Microsoft Internet Controls
  5. Click OK



回答3:


Add a COM reference to c:\windows\system\shdocvw.dll

This will create a .NET reference Interop.shdocvw.dll (or something similar) that includes the appropriate types.



来源:https://stackoverflow.com/questions/3345687/c-in-what-assembly-is-shdocvw-webbrowser-v1-defined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!