zoukankan      html  css  js  c++  java
  • C#开发COM+组件和ActiveX控件

    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Security;
    using System.Resources;
    
    // General Information about an assembly is controlled through the following 
    // set of attributes. Change these attribute values to modify the information
    // associated with an assembly.
    [assembly: AssemblyTitle("SecurePassword")]
    [assembly: AssemblyDescription("")]
    [assembly: AssemblyConfiguration("")]
    [assembly: AssemblyCompany("")]
    [assembly: AssemblyProduct("SecurePassword")]
    [assembly: AssemblyCopyright("Copyright ©  2013")]
    [assembly: AssemblyTrademark("")]
    [assembly: AssemblyCulture("")]
    [assembly: AllowPartiallyTrustedCallers()]
    
    // Setting ComVisible to false makes the types in this assembly not visible 
    // to COM components.  If you need to access a type in this assembly from 
    // COM, set the ComVisible attribute to true on that type.
    [assembly: ComVisible(true)]
    
    // The following GUID is for the ID of the typelib if this project is exposed to COM
    [assembly: Guid("A49D98D5-354D-42E1-99A3-0361781B1DAA")]
    
    // Version information for an assembly consists of the following four values:
    //
    //      Major Version
    //      Minor Version 
    //      Build Number
    //      Revision
    //
    // You can specify all the values or you can default the Build and Revision Numbers 
    // by using the '*' as shown below:
    // [assembly: AssemblyVersion("1.0.*")]
    [assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion("1.0.0.0")]
    [assembly: NeutralResourcesLanguageAttribute("en-US")]
    AssemblyInfo.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    
    namespace SecurePassword
    {
        [Guid("C9BC5F05-9A41-4B45-94A6-CCFDD033CA9D")]
        public class SecurePasswordInput : TextBox, IObjectSafety
        {
    
            public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
            {
                pdwSupportedOptions = 1;
                pdwEnabledOptions = 2;
            }
    
            public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
            {
                throw new NotImplementedException();
            }
        }
    }
    SecurePasswordInput.cs
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript" language="javascript">
            function showPassword() {
                window.alert(form1.SecurePasswordInput.Text());
            }
        </script>
    </head>
    <body>
        <form id="form1" action="Test.htm" method="post">
        <object id="SecurePasswordInput" classid="clsid:{A49D98D5-354D-42E1-99A3-0361781B1DAA}">
            <param name="PasswordChar" value="*" />
        </object>
        <input id="showInput" type="button" value="Click Me" onclick="showPassword();" /></form>
    </body>
    </html>
    

    全部技术和代码出自 http://www.cnblogs.com/RCFans/archive/2008/11/15/1333982.html

    签名的ActiveX控件还没搞出来在继续尝试

  • 相关阅读:
    Go从入门到精通——Go语言中程序文件的组织方法
    Go从入门到精通——怎样查看 Go 语言的文档
    AU篇——处理人声混BGM_(尽可能)去BGM提取人声
    【漏洞分析】DDOS攻防分析(一)——DNS篇
    【网络安全设备系列】15、安全网关/统一威胁管理(UTM)
    【网络安全设备系列】14、堡垒机
    【网络安全设备系列】13、网页防篡改
    【网络安全设备系列】12、态势感知
    【网络安全设备系列】11、抗DDOS设备
    【网络安全设备系列】10、安全审计系统
  • 原文地址:https://www.cnblogs.com/sskset/p/3282254.html
Copyright © 2011-2022 走看看