关闭

从IE打开外部应用程序

标签: iestringdeletefunctionwindowsclass
1137人阅读 评论(1) 收藏 举报
分类:

先修改客户端的注册表:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT/FBUID]
"URL Protocol"=""

[HKEY_CLASSES_ROOT/FBUID/Shell]

[HKEY_CLASSES_ROOT/FBUID/Shell/Open]

[HKEY_CLASSES_ROOT/FBUID/Shell/Open/Command]
@="/"D://Documents//Visual Studio 2005//Projects//Labs//ConsoleApplication1//ConsoleApplication1//bin//Debug//ConsoleApplication1.exe/" %1"

ConsoleApplication代码

    class Program

    {

        [System.Security.Permissions.FileIOPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.EnvironmentPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.UIPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.RegistryPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.ReflectionPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.FileDialogPermission(System.Security.Permissions.SecurityAction.Demand)]

        [System.Security.Permissions.HostProtection(System.Security.Permissions.SecurityAction.Demand)]

        static void Main(string[] args)

        {

            System.Console.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name);

            System.Console.WriteLine(string.Join(" ", args));

            System.Console.ReadLine();

        }

    }

 

示例使用代码:

<script>
function CheckFBUIDIsInstalled(anchorControl,installUrl)
{
 try
 {
  var obj = new ActiveXObject("FBUID.UIDesignerObj");     //need register the type
  //var obj = new ActiveXObject("Microsoft.XMLHTTP");
  if (obj == null)
  {
   delete obj;
   return;
  }
 }
 catch(e)
 {
  anchorControl["href"] = installUrl;
 }
 
}
</script>
<A href="FBUID:test" onclick="CheckFBUIDIsInstalled(this, 'http://www.test.com');">Open FBUID</A>

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:71051次
    • 积分:1025
    • 等级:
    • 排名:千里之外
    • 原创:26篇
    • 转载:34篇
    • 译文:0篇
    • 评论:10条
    文章分类
    最新评论