创建和部署一个ActiveX控件在.NET [英] Creating and deploying an ActiveX control in .NET

查看:266
本文介绍了创建和部署一个ActiveX控件在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于显然是没有闪光控制,可以接受位图膏,我想考虑写一个自己。我宁可不使用闪光灯的,所以我虽然有关使用.NET。

Since there is apparently no Flash control that can accept bitmap pastes, I want to think about writing one myself. I'd rather not use Flash though, so I though about using .NET.

现在我认为正确的术语,可以下载并运行在浏览器本地code控制是ActiveX控件。所以我的问题是,我可以创造这样一个ActiveX控件与.NET?

Now I believe the correct terminology for a native code control that can be downloaded and run in the browser is "ActiveX control". So my question is, can I create such an ActiveX control with .NET?

我在网上找到一些教程,但他们都希望你已经装配安装在本地计算机上,并注册和信赖它和多数民众赞成访问它的网站。

I've found some tutorials on the web, but they all expect you to have the assembly installed on your local machine, and registered and trusted both it and the website that's accessing it.

这是要求有点多潜在的匿名网络用户,甚至对于内网用户部署的另一种方法是preferable。

This is asking a bit much for potential anonymous internet users, and even for intranet users another method of deployment would be preferable.

我清楚地记得一些网站要求我下载这样或那样的ActiveX控件。而就规定该浏览器插件如Flash和Java页面,还有通过该浏览器知道在哪里可以获取插件的媒体类型的一些机制。

I distinctly remember some website asking me to download this or that ActiveX control. And on pages requiring such browser plugins as Flash and Java, there is some mechanism by which the browser knows where to fetch the plugin for that media type.

所以我的问题是双重的:

So my question is twofold:

  • 我可以创建在用户的浏览器在.NET运行控制?
  • 什么是(半)自动传送我能做到的最好方法是什么?


在回应阳光:

是的,很多JavaScript的富文本编辑器允许您将链接图片粘贴到一个文本字段,它会插入正确的< IMG>标签。然而,这仅适用于已经在网络上某个位置的图像,我希望这只是通过复制上传新图片/从剪贴板粘贴任何随机的位图。

Yes, a lot of JavaScript rich text editors allow you to paste a linked image into a text field, and it will insert the correct <img> tag. However, this only works for images that already have a location on the web, and I want this to upload new images just by copy/pasting any random bitmap from your clipboard.

推荐答案

如果你没事与IE浏览器而已,我喜欢的IE浏览器承载控制的安全模型过度活跃-X,不过,由于09年1月1日,微软德precates使用.NET(过程)来扩展IE所以XBAP是好的,但不是在ActiveX控件或IE托管控制。

If you're okay with IE only, I like the IE hosted control's security model over Active-X, however, as of 1/1/09, Microsoft deprecates the use of .NET (in process) to extend IE so XBAP is okay, but not in ActiveX controls or IE Hosted controls.

更新7/13:微软已经公布的的实施过程中的扩展指导;它仍然是德precated。

Update 7/13: Microsoft has published guidance on implementing in-process extensions; it's still deprecated.

编辑:W / O调整注册表,IE8只会加载.NET托管从内部网络控制或受信任的区域相对常规的互联网使用,主动-X需要在浏览器的完全信任访问

W/o tweaking the registry, IE8 will only load a .NET hosted control from the intranet or trusted zone so for general internet use, Active-X is required for in-browser full trust access.

要跟进拉斯的帖子:Silverlight的无法访问剪贴板:的http:// Silverlight的.NET /论坛/吨/ 13024.aspx

To follow up on Russ's post: Silverlight can't access the clipboard: http://silverlight.net/forums/t/13024.aspx

大多数IE托管控制信息是在博客,所以我使用:的 http://www.google.com/search?q=ie+hosted+control+site:msdn.com 找到他们。下面是那些我发现特别有用。

Most of the IE hosted control information is in blogs so I use: http://www.google.com/search?q=ie+hosted+control+site:msdn.com to find them. Below are the ones I've found particularly useful.

快速,方便的控制:<一href="http://blogs.msdn.com/mikechr/archive/2006/11/28/writing-a-simple-managed-control-under-ie.aspx" rel="nofollow">http://blogs.msdn.com/mikechr/archive/2006/11/28/writing-a-simple-managed-control-under-ie.aspx

有关安全性的奇怪的事情,除非证据是一个URL,该组件可以信任的,但不是域,需要断言来解决:<一href="http://blogs.msdn.com/carloc/archive/2006/11/01/$c$c-access-security-hosting-control-in-ie.aspx" rel="nofollow">http://blogs.msdn.com/carloc/archive/2006/11/01/$c$c-access-security-hosting-control-in-ie.aspx

Odd thing about security, unless the "evidence" is a url, the assembly may be trusted, but not the domain, requiring asserts to fix: http://blogs.msdn.com/carloc/archive/2006/11/01/code-access-security-hosting-control-in-ie.aspx

这是固定在3.5与体现。这是复杂的,以得到正确的故见使用舱单从Shawnfa的.NET安全博客的的 .NET 3.5 Beta版和的 GA后.NET 3.5 。托德的随机发现博客中还记录了步骤创建清单对东道主控制

This is "fixed" in 3.5 with manifests. It's complicated to get right so see the instructions on using manifests from Shawnfa's .NET Security Blog for the .NET 3.5 Beta and post GA .NET 3.5. Todd's Random Discovery blog also documents the steps for creating a manifest for a hosted control

我发现这个有用的关于建立安全知识库文章,但你仍然要学习了很多关于CAS:的 http://support.microsoft.com/kb/892466 。这可能是决定何时使用(.NET)的Active-X VS的IE浏览器承载的控制主要考虑的 - 那就是,什么样的安全模型,为您和您的用户效果最好。我的希望是,使用清单将使IE托管控制工作就像点击一次,用户被要求信任和正确的设置是由系统创建。对于我的公司,我们使用可以自动设置安全的用户,以便主办的即是我们的选择。

I found this useful from a KB article on setting up the security, but you'll still have to learn quite a bit about CAS: http://support.microsoft.com/kb/892466. This is probably the main consideration when deciding to use a (.net) Active-X vs an IE hosted control - that is, what security model works best for you and your users. My hope is that using manifest will make IE hosted controls work like click-once where the user is asked to "trust" and the correct settings are created by the system. For my company we used could automate setting up the security for the user so an ie hosted was our choice.

有一件事我从来没有想通了,如果我做了或没有从(用户)控制的UI无极变速控制继承。它的工作更好地为我这样做,但我不得不躲在div对象标记住在纽约。

The one thing I never figured out was if I did or didn't have to inherit from (User)control for a ui-less control. It worked better for me to do so, but I had to "hide" the div the object tag lived in.

可以很容易地控制调试,如果你编译调试和连接到IE浏览器的管理调试一旦你的控制加载。如果你不能得到控制加载,查询信息的融合集绑定浏览器:的 http://msdn.microsoft.com/en-us/library/e74a18c4.aspx 以及如何打开IEHost跟踪:的 http://support.microsoft.com/kb/313892 为了调试的加载过程。

It's easy to debug the control if you compile for debug and attach to IE for "managed" debugging once you get the control to load. If you can't get the control to load, look up info on the fusion assembly binding viewer: http://msdn.microsoft.com/en-us/library/e74a18c4.aspx and how to turn on IEHost tracing: http://support.microsoft.com/kb/313892 in order to debug the load process.

请务必版本每个版本的程序集。如果不这样做,那么IE会很困惑,并不会加载该控件时,在下载缓存中的组件不同,但具有相同的版本号为一体的URL引用(GACUTIL / CDL清除.NET下载缓存)

Be sure to version every version of the assembly. If you don't, then IE gets confused and won't load the control when the assembly in the download cache is different but has the same version # as the one the url references (gacutil /cdl clears the .net download cache)

这篇关于创建和部署一个ActiveX控件在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆