???????C#??дIObjectSafety??
using System;
using System.Runtime.InteropServices;
namespace KeyActiveX
{
[ComImport?? Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IObjectSafety
{
[PreserveSig]
void GetInterfacceSafyOptions(
int riid??
out int pdwSupportedOptions??
out int pdwEnabledOptions);
[PreserveSig]
void SetInterfaceSafetyOptions(
int riid??
int dwOptionsSetMask??
int dwEnabledOptions);
}
}
????InterfaceType?????????ComInterfaceType.InterfaceIsIUnknown?????IObjectSafety?????IUnkown??
????????????KeyActiveX????????
namespace KeyActiveX
{
[Guid("94882155-3B7C-48e3-B357-234D56D8F15E")]
public partial class IdentityKey : UserControl?? IObjectSafety
{
#region 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();
}
#endregion
}
}
????????????????????????IE??????????????μ?http://support.microsoft.com/kb/182598/
?????????????????
????C#??????ActiveX?????????????????
????1.??????????????????????????????
????2.????????????????????????????
????3.???html??object??codebase???????????
???????????????????????????????????????????????????????????????????????????????Ρ??????ε??????????????????????Versign?????????????????????????????????
????????????Visual Studio 2008??????????鴴??????MakeCert?????????SignTool???в?????????????????й????????????飬??Visual Studio???????????????
????makecert -sk ABC -n "CN=ABC Corporation" f:abccorptest.cer
??????F??????????????顣???????
????signtool signwizard
??????Signing Options?????????Custom??????????????λ????????????????????????MD5??SHA1?????????ó?????????????URL??????
???????ActiveX?????????????????????δ???ε??????飬?????IE?????????δ????????????html??????
????<object id="controlbyid" classid="clsid:{94882155-3B7C-48e3-B357-234D56D8F15E}" codebase="setup.exe" ></object>
?????????????????????ActiveX??????