c#开发active控件

haiyun141 2013-01-03 02:51:10
最近公司需要用到在线拍照功能,在网上找了好几个控件,用着都不感觉不好,于是,自己开始动手写。中间遇到些问题。和大家探讨下,希望能得到解决。
使用的是.net4.0框架,新建了一个windows控件库,在网上查资料,说要在assembly.cs文件里加[assembly:AllowPartiallyTrustedCallers()]节点,得到什么权限,但只要我加上,就报错

反正是公司内部用,也就不要什么权限验证什么的,就把这个去掉了,自己做了个安装包,放到服务器,然后要实施人员自己从服务器下载给用户安装插件,用着也蛮好的。但现在我这个控件做了些优化,需要重新发布安装,但在安装时,报错了

.这下郁闷了。。按照提示进控制面板删除了原来的版本还是不行。。。
求指导,怎么实现自动安装,上面两个报错怎么解决,是什么原因造成的。大家一起讨论下。。。
...全文
301 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
linmilove 2013-11-08
  • 打赏
  • 举报
回复
八信通网站也需要这样的功能,能分享下吗?
haiyun141 2013-01-03
  • 打赏
  • 举报
回复
怎么没人讨论啊,刚看到一个,说active不能调用win32的api,请问这个说法对吗?如果是对的话,问题就不需要问下去了。。
haiyun141 2013-01-03
  • 打赏
  • 举报
回复
引用 2 楼 sp1234 的回复:
找一个你懂得的控件(特别是COM控件)来用,不要弄一堆不懂的控件。 这个帮不了你。劝你从头开始考虑!
蛋疼,第三方组件就是系统自带的, //全局变量 private int hHwnd; /// <summary> /// 必需的设计器变量。 /// </summary> [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern int capCreateCaptureWindowA([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszWindowName, int dwStyle, int x, int y, int nWidth, short nHeight, int hWndParent, int nID); [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern bool capGetDriverDescriptionA(short wDriver, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszName, int cbName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszVer, int cbVer); [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern bool DestroyWindow(int hndw); [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern int SendMessage(int hwnd, int wMsg, int wParam, [MarshalAs(UnmanagedType.AsAny)] object lParam); [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern int SetWindowPos(int hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags); [DllImport("vfw32.dll")] public static extern string capVideoStreamCallback(int hwnd, videohdr_tag videohdr_tag); [DllImport("vicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern bool capSetCallbackOnFrame(int hwnd, string s); 这有什么不好意思的。。这话说的。。。要是能解决问题,源码公布都没问题,就是怕大神们懒的看。。
  • 打赏
  • 举报
回复
你用到了第三方COM组件,就不要不好意思公布出来。否则无法解决问题。
  • 打赏
  • 举报
回复
找一个你懂得的控件(特别是COM控件)来用,不要弄一堆不懂的控件。 这个帮不了你。劝你从头开始考虑!
eason-zhao 2013-01-03
  • 打赏
  • 举报
回复
高手!不过这个真的不懂,帮顶!

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧