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 %>
上传时间: 2016-07-14
上传用户:helei0915
caculation,method,gold,optimazation theory and methods,matlab
标签: caculation method gold optimazation
上传时间: 2016-12-22
上传用户:杨一一一
1.Describe a Θ(n lg n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x. (Implement exercise 2.3-7.)
上传时间: 2017-04-01
上传用户:糖儿水嘻嘻
1.Describe a Θ(n lg n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x. (Implement exercise 2.3-7.) #include<stdio.h> #include<stdlib.h> void merge(int arr[],int low,int mid,int high){ int i,k; int *tmp=(int*)malloc((high-low+1)*sizeof(int)); int left_low=low; int left_high=mid; int right_low=mid+1; int right_high=high; for(k=0;left_low<=left_high&&right_low<=right_high;k++) { if(arr[left_low]<=arr[right_low]){ tmp[k]=arr[left_low++]; } else{ tmp[k]=arr[right_low++]; } } if(left_low<=left_high){ for(i=left_low;i<=left_high;i++){ tmp[k++]=arr[i]; } } if(right_low<=right_high){ for(i=right_low;i<=right_high;i++) tmp[k++]=arr[i]; } for(i=0;i<high-low+1;i++) arr[low+i]=tmp[i]; } void merge_sort(int a[],int p,int r){ int q; if(p<r){ q=(p+r)/2; merge_sort(a,p,q); merge_sort(a,q+1,r); merge(a,p,q,r); } } int main(){ int a[8]={3,5,8,6,4,1,1}; int i,j; int x=10; merge_sort(a,0,6); printf("after Merging-Sort:\n"); for(i=0;i<7;i++){ printf("%d",a[i]); } printf("\n"); i=0;j=6; do{ if(a[i]+a[j]==x){ printf("exist"); break; } if(a[i]+a[j]>x) j--; if(a[i]+a[j]<x) i++; }while(i<=j); if(i>j) printf("not exist"); system("pause"); return 0; }
上传时间: 2017-04-01
上传用户:糖儿水嘻嘻
To locate the theory of Lie groups within mathematics, one can say that Lie groups are groups with some additional structure that permits us to apply analytic techniques such as differentiation in a group theoretic context.
标签: Structure Geometry Groups Lie and of
上传时间: 2017-07-31
上传用户:wyq3536
TMS320F240DSP的汇编指令,用于了解该型号dsp的汇编指令的及具体含义,以便进行汇编指令的编写
标签: instruction 320F F240 TMS 320 240 set
上传时间: 2017-11-16
上传用户:yhj140260126
Fundamentals of Wavelets - Theory Algorithms and Applications 2ed_Jaideva C.Goswami Wiley 2011
标签: Fundamentals Applications Algorithms Wavelets Theory 2ed and of
上传时间: 2018-03-22
上传用户:caigen0001
Optimal Guaranteed Cost Sliding-Mode Control of Interval Type-2 Fuzzy Time-Delay Systems
上传时间: 2019-07-24
上传用户:sjjy0220
在微电网调度过程中综合考虑经济、环境、蓄电池的 循环电量,建立多目标优化数学模型。针对传统多目标粒子 群算法(multi-objective particle swarm optimization,MOPSO) 的不足,提出引入模糊聚类分析的多目标粒子群算法 (multi-objective particle swarm optimization algorithm based on fuzzy clustering,FCMOPSO),在迭代过程中引入模糊聚 类分析来寻找每代的集群最优解。与 MOPSO 相比, FCMOPSO 增强了算法的稳定性与全局搜索能力,同时使优 化结果中 Pareto 前沿分布更均匀。在求得 Pareto 最优解集 后,再根据各目标的重要程度,用模糊模型识别从最优解集 中找出不同情况下的最优方案。最后以一欧洲典型微电网为 例,验证算法的有效性和可行性。
上传时间: 2019-11-11
上传用户:Dr.赵劲帅
在学习得到的模型投放使用之前,通常需要对其进行性能 评估。为此, 需使用一个“测试集”(testing set)来测试 模型对新样本的泛化能力,然后以测试集上的“测试误差 ”(testing error)作为泛化误差的近似。
上传时间: 2020-04-22
上传用户:89feiyang