远程视频监控控件调用
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RFIDESD.VideoWeb._Default" %>
<!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 runat="server"> <title>菲博特电子科技(深圳)有限公司 E视动调用视频测试</title> <object id="XEnroll" classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" codebase="xenroll.dll"></object> <script language="vbscript" type="text/vbscript"> ON ERROR resume next
sPKCS7="" sPKCS7=sPKCS7 & "-----BEGIN CERTIFICATE-----" & vbcrlf sPKCS7=sPKCS7 & "MIIEMDCCAxigAwIBAgIQIwvmOpvuQZRHEJPZzwkN4jANBgkqhkiG9w0BAQUFADA0" & vbcrlf sPKCS7=sPKCS7 & "MTIwMAYDVQQDDCnoj7LljZrnibnnlLXlrZDnp5HmioAo5rex5ZyzKeaciemZkOWF" & vbcrlf sPKCS7=sPKCS7 & "rOWPuDAeFw0xMDAzMjkwNTU4MDZaFw0yMDAzMjkwNjA1MTRaMDQxMjAwBgNVBAMM" & vbcrlf sPKCS7=sPKCS7 & "KeiPsuWNmueJueeUteWtkOenkeaKgCjmt7HlnLMp5pyJ6ZmQ5YWs5Y+4MIIBIjAN" & vbcrlf sPKCS7=sPKCS7 & "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt554ngrDqQWJAMZI+PuljpszKQMg" & vbcrlf sPKCS7=sPKCS7 & "d/FUxJ1Cw5Qure4PNJAaazmI+6jGY40Ki1g+y1Q5kqCwwUTSqFnp90W51tx8y7pj" & vbcrlf sPKCS7=sPKCS7 & "uKNMPEHuY3DUMnitTk+yaSdwCaUMm7guVWjTiYYH5FXASqbnHBYNdj0p1z3hpOoA" & vbcrlf sPKCS7=sPKCS7 & "SHji18tsZxbkNLTdSExPm+Cp52t+M4OlabvlbsOE5v6GbxCVcEy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cL9Nd5AZIoTtsgs8Cy2nP3VmSwGF0" & vbcrlf sPKCS7=sPKCS7 & "+HfaqSgl8Sj2zkJ9SwT+e8Ez3u6XY9gqvSkkDBnlWVRsr8B+LN3Z/87S99hN+8UE" & vbcrlf sPKCS7=sPKCS7 & "CnW435spE7VSySPoQVTHqV82bB4aJkI7z7dVJcAMaY9Vk7+lfqwmhswfFMA/C8oW" & vbcrlf sPKCS7=sPKCS7 & "epuCWF/lDZu8I0nsdXnymqa3BRg=" & vbcrlf sPKCS7=sPKCS7 & "-----END CERTIFICATE-----" & vbcrlf // XEnroll.AcceptPkcs7(sPKCS7)// if err.Number <> 0 then// if err.number = -2146885628 then// MsgBox "系统中已经存在该证书,或证书不是在这台机器申请的"// else// MsgBox "证书下载时出错,错误号="&err.description// end if// else
// MsgBox "证书已成功装入"// End if
XEnroll.InstallPKCS7 sPKCS7 If err.number = 438 then msgbox "根证书安装失败,请联系管理员 ." window.close() Elseif err.number <> 0 then msgbox "根证书安装失败,请联系管理员 ." window.close() Else msgbox "根证书安装成功." End if </script> <script language="javascript" type="text/javascript">// var lpServerIP = "192.168.2.180";//硬盘录像机ip// var lPort = 8001;// var lpUserName = "admin";// var lpPassword = "12345";// var lChannelNum = 2; var lpServerIP = "<%=getIpServerIP()%>";//硬盘录像机ip var lPort = "<%=iPort %>"; var lpUserName = "<%=getlpUserName()%>"; var lpPassword = "<%=getlpPassword()%>"; var lChannelNum = "<%=iChannelNum %>"; var UserID function Play() { var i; var Netocx = document.getElementById("NetOCX"); UserID = Netocx.Login(lpServerIP,lPort,lpUserName,lpPassword); i = Netocx.StartRealPlay(lChannelNum,0, 0); if (i == 0) { alert("预览失败!"); } }
function Stop() { var Netocx = document.getElementById("NetOCX"); Netocx.StopRealPlay(); Netocx.Logout(); }
function FullScreen() { var Netocx = document.getElementById("NetOCX"); Netocx.FullScreenCtrl(); }
function Play1() { var Netocx1 = document.getElementById("NetOCX1"); UserID = Netocx1.Login("172.7.76.85",8000,"admin","12345"); Netocx1.StartRealPlay(0 ,0, 0); }
function Stop1() { var Netocx1 = document.getElementById("NetOCX1"); Netocx1.StopRealPlay(); Netocx1.Logout(); }
</script><style type="text/css"> #center { position:absolute;left:50%; top:15%; z-index:1;margin-left:-150px; margin-top:-32px;width: 407px; } </style> </head><body onload="Play()"> <form id="form1" runat="server"> <div id="center"> <table style="width:407px; height:200" border="0"> <tr align="center"> <td style="width:1004;height:100">菲博特电子科技(深圳)有限公司 E视动调用视频测试</td> </tr> <tr align="center"> <td style="width:1004;height:100"></td> </tr> </table> <table style="width:1004;height:500" border="0"> <tr> <td style="width:1004;height:400" colspan="3" align="center"> <object classid="clsid:CAFCF48D-8E34-4490-8154-026191D73924" codebase="./NetVideoActiveX23.cab#version=2,3,9,1" standby="Waiting..." id="NetOCX" width="400" height="300" name="ocx" > </object></td> </tr> <tr> <td align="center"> <input type="button" name="Play" value=" 预览 " onclick = "Play()" /> <input type="button" name="Stop" value=" 停止 " onclick = "Stop()" /> </td> </tr> </table> </div> </form></body></html>
//NetVideoActiveX23.cab此文件可到海康官方下载