C# ActiveX 插入网页中被阻止的问题。
用C# 写了一个ActiveX,生成EXE安装后,插入到网页中后,每次打开这个网页都会出现如第一张图一样的提示,每次涉及到ActiveX的操作是都会出现如第二张图一样的提示...请问是不是因为IObjectSafety接口没写好的原因???
<object id="UploadFileActiveX" classid="clsid:09cf100e-ab57-439d-9165-707d3c1bb7f1" width="800px" height="300px"></object><br />
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace UploadFileActiveX
{
[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);
}
}
#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 Exception("The method or operation is not implemented.");
}
#endregion
补充:.NET技术 , C#