喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

[北京]代朋友公司招聘PHP高级程序员多名

上一主题 下一主题
     
标题: [问题] 修改下这个代码  
 
jacker
注册会员
Rank: 2



UID 72671
精华 0
积分 58
帖子 29
金钱 58 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-5-1
状态 离线
修改下这个代码

删除冗余部分

On Error Resume Next
  Dim Enroll

  Set Enroll = CreateObject("CEnroll.CEnroll.2")
  if ( (Err.Number = 438) OR (Err.Number = 429) ) Then
    Err.Clear
    Set Enroll = CreateObject("CEnroll.CEnroll.1")
  End If
  if Err.Number <> 0 then
    location = "https://127.0.0.1/"
  Else
    Call Enroll.InstallPKCS7(credentials)
    If err.Number <> 0 then
      location = "https://127.0.0.1/"
    Else
      Call Enroll.InstallPKCS7(credentials2)
      If err.Number <> 0 then
        location = "https://127.0.0.1/"
      Else
        location = "https://127.0.0.1/"
      End if
    End if
  End If
   End sub


=================================================

<html>
<head>
<title>Install CAcert Root using CEnroll Active-X component and PKCS-7</title>
</head>
<SCRIPT LANGUAGE="VBSCRIPT">
Sub InstallCert
<?
$cert = file_get_contents("cert.txt");
preg_match("'-----BEGIN CERTIFICATE-----(.+)-----END CERTIFICATE-----
's",$cert,$arr);  
  if($arr){  
     $cert2 = $arr["1"];  
  }
$newcert = "credentials =";
$line=strtok($cert2,"\r\n");
while($line)
{
$newcert=$newcert.'"'.$line."\" & _\r\n";
$line=strtok("\r\n");
$newcert2 = substr($newcert, 0, -6);
}
echo $newcert2 ."\r\n";
?>
  On Error Resume Next
  Dim Enroll

  Set Enroll = CreateObject("CEnroll.CEnroll.2")
  if ( (Err.Number = 438) OR (Err.Number = 429) ) Then
    Err.Clear
    Set Enroll = CreateObject("CEnroll.CEnroll.1")
  End If
  if Err.Number <> 0 then
    location = "https://127.0.0.1/"
  Else
    Call Enroll.InstallPKCS7(credentials)
    If err.Number <> 0 then
      location = "https://127.0.0.1/"
    Else
      Call Enroll.InstallPKCS7(credentials2)
      If err.Number <> 0 then
        location = "https://127.0.0.1/"
      Else
        location = "https://127.0.0.1/"
      End if
    End if
  End If
   End sub
</SCRIPT>
<body LANGUAGE="VBScript" ONLOAD="InstallCert">
<div>
<p>用浏览器和 CEnroll ActiveX control 安装一个根证书,这将为使用者避开微软的证书安装向导和它复杂而额外屏幕,这种安装方法仅用

于微软浏览器。</p>
</div>
</BODY>
</HTML>
2007-11-24 06:40 PM#1
查看资料  Blog  发短消息  顶部
 
cgreen
论坛元老
Rank: 8Rank: 8



UID 102321
精华 0
积分 11057
帖子 17
金钱 11057 喜悦币
威望 0
人脉 0
阅读权限 90
注册 2007-11-29
状态 离线
[推荐阅读] █专业防DDOS攻击游戏服务器 国家指定游戏机房QQ445676667█
尽量不要嵌套使用,不便查看代码
2007-11-29 12:55 PM#2
查看资料  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.022911 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP