asp實現限制一個ip只能訪問一次的方法
<%
'/////////////////////////////////////////////////////
'// //
'//作用:一個IP地址只允許訪問本頁一次 //
'//引用:<!-- #include file="Check_Ip.asp" --> //
'// //
'/////////////////////////////////////////////////////
'Response.Charset = 936 '設置輸出編碼為簡體中文
'Response.Buffer = false '關閉緩沖區
Dim Fso,ts,IpList,Cfs
'設置Cookies函數
Function SetCookie()
Response.Cookies("IsBrow") = "Brow"
Response.Cookies("IsBrow").Expires = Date+365
End Function
'記錄IP地址函數
Function WriteIp(FileName, IpAddress)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set ts = Fso.OpenTextFile(Server.MapPath(FileName),8,true)
ts.WriteLine IpAddress
ts.Close
Set ts = Nothing
Set Fso = Nothing
End Function
'讀取IP地址函數
Function ReadIpList(FileName)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
If Not Fso.FileExists(Server.MapPath(FileName)) Then
CreateFile("Iplist.txt")
Exit Function
End If
Set ts = Fso.OpenTextFile(Server.MapPath(FileName))
Iplist = ts.ReadAll
ts.Close
Set ts = Nothing
Set Fso = Nothing
ReadIpList = Iplist
End Function
'創建文件函數
Function CreateFile(FileName)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set Cfs = Fso.CreateTextFile(Server.MapPath(FileName))
Cfs.Close
Set Cfs = Nothing
Set Fso = Nothing
End Function
'關閉當前IE窗口函數(注:IE6下通過,其他瀏覽器未測試)
Function CloseWindow()
'Response.Write "<script>window.location='javascript:window.opener=null;window.close();'</script>"
Response.Redirect "http://www.baidu.com"
End Function
Ip = Request.ServerVariables("REMOTE_ADDR") '獲取瀏覽者IP地址
Cookie = Request.Cookies("IsBrow") '獲取當前Cookies
'Response.Write Cookie
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" Then
Response.Write "本站不允許使用代理訪問"
Response.End()
Else
If Cookie = "Brow" Then
CloseWindow()
Else
If Instr(ReadIpList("Iplist.txt"),Ip) <>0 Then
CloseWindow()
Else
WriteIp "Iplist.txt" , Ip
End If
SetCookie()
End If
End If
%>
標簽:
asp
訪問
上傳時間:
2016-07-14
上傳用戶:helei0915
電力系統遠程監控,即遠動,就是應用通信技術對遠方的運行設備進行監視和控制,以實現遠程測量、遠程信號傳輸、遠程控制和調節等多項功能。隨著國民經濟的發展,越來越多的遠程監控應用于電力系統和其他工業應用場合,人們對無人值班的需求越來越大,用戶對遠程監控的通信質量和通信可靠性的要求也越來越高。但是由于通信信道的制約和通信規約的不一致性,限制了系統的推廣。目前,遠程監控系統一直隨著自動化、計算機和通信技術的發展,要求系統和IDEs能符合全球變電站數字化和設備通用化的要求,因此對遠程控制的關鍵技術進行研究具有重要的理論意義和實用價值。 基于遠程監控的實際需求和對于降低通信的成本的考慮,簡化通信的處理需求,以及廣闊的市場需求,促使我們開展了對遠程監控系統的研究。 本文對我國電力監控遠程控制系統發展概況進行了綜述,對國外典型的變電站自動化系統進行了分析;對變電站自動化系統通信網絡的現狀和通信協議的應用現狀進行了分析;對電力系統遠程監控系統的通信信道、通信規約和后臺監控平臺等若干關鍵技術問題進行深入研究;在實現基于
標簽:
電力系統
遠程監控
若干問題
上傳時間:
2013-07-31
上傳用戶:dreamboy36