惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
T
The Exploit Database - CXSecurity.com
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
F
Fortinet All Blogs
博客园_首页
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
The Cloudflare Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
H
Heimdal Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Security Affairs
The Register - Security
The Register - Security
S
Security @ Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
T
Tailwind CSS Blog
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
D
Docker
L
LangChain Blog
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
The Hacker News
The Hacker News
AWS News Blog
AWS News Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
宝玉的分享
宝玉的分享
I
Intezer
云风的 BLOG
云风的 BLOG
V2EX - 技术
V2EX - 技术
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - 胡敏

WebSharp 3.0(个人修订版)全代码,WebSharp 的作者已经抛弃它了吗?(一个国产ORM框架) 从追MM谈Java的23种设计模式 - 太经典了,转到自己的BLOG上收藏着先 AutoCAD二次开发之创建菜单 我的家——三维地图 一个数独问题的算法(已更新,提供一个简单算法,欢迎拍砖) 生活在垃圾网络中,我们该怎么办? vs.net 2005 中文版下载 c#调用des64.dll进行加密解密 - 胡敏 - 博客园 MapXtreme 2004 6.2 中文版破解文件及安装方法(已经不提供下载) 提供MapXtreme 2004 6.2 NCP破解文件及安装方法(已经不能提供了,等待破解最新的吧) 爆笑经典签名 一句话经典笑话 MapXtreme2004新手资料续 MapXtreme2004初学者资料(整理) 移动用户查询手机开通的服务 使用 Rational XDE for .net建模和设计数据库(原创) 自己动手注册xde for .net帮助 如何得到别人收藏夹里的网址 十种你不知道的东西,绝对经典(如果你知道就不用点了,该休息了)(转)
利用.net创建安全COM控件
胡敏 · 2007-07-18 · via 博客园 - 胡敏

创建控件,其实就是创建一个dll,把他注册成COM  控件,并给它导入安全接口。
(安全是指在调用是不会弹出安全对话框)

using System;

using System.Runtime.InteropServices;

namespace openOffice

{

     /// <summary>

     /// IObjectSafety 的摘要说明。

     /// </summary>

     [Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]

     public interface IObjectSafety

     {

         // methods

         void GetInterfacceSafyOptions(

              System.Int32 riid,

              out System.Int32 pdwSupportedOptions,

              out System.Int32 pdwEnabledOptions);

         void SetInterfaceSafetyOptions(

              System.Int32 riid,

              System.Int32 dwOptionsSetMask,

              System.Int32 dwEnabledOptions);     

     }

}

using System;

using System.Collections.Generic;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

using Word = Microsoft.Office.Interop.Word;

using Excel = Microsoft.Office.Interop.Excel;

using OpenOffice.localhost;

using System.Net;

using System.IO;

namespace openOffice

{

    [Guid("B783512A-CA69-4b1e-97D7-1EC0FAEFC13B"), ProgId("openOffice.DmosClient")]

    public class DmosClient : IObjectSafety, IDmosClient

    {

        public void ShowMessage(string msg)

        {

            MessageBox.Show(msg);

        }

        #region IObjectSafety 成员

        public void GetInterfacceSafyOptions(Int32 riid, out Int32 pdwSupportedOptions, out Int32 pdwEnabledOptions)

        {

            // TODO:  添加WebCamControl.GetInterfacceSafyOptions 实现

            pdwSupportedOptions = CLsObjectSafety.INTERFACESAFE_FOR_UNTRUSTED_CALLER;

            pdwEnabledOptions = CLsObjectSafety.INTERFACESAFE_FOR_UNTRUSTED_DATA;

        }

        public void SetInterfaceSafetyOptions(Int32 riid, Int32 dwOptionsSetMask, Int32 dwEnabledOptions)

        {

            // TODO:  添加WebCamControl.SetInterfaceSafetyOptions 实现             

        }

        #endregion

    }

}

using System;

namespace openOffice

{

     /// <summary>

     /// CLsObjectSafety 的摘要说明。

     /// </summary>

     public class CLsObjectSafety

     {

         public const System.Int32 INTERFACESAFE_FOR_UNTRUSTED_CALLER = 0x00000001;

         public const System.Int32 INTERFACESAFE_FOR_UNTRUSTED_DATA = 0x00000002;

     }

}