<%data_path="../"%>
<!--#include file="../conn/conn.asp"-->
<%
'Dim Conn
'Dim Connstr
'Set Conn=server.createobject("ADODB.CONNECTION")
'
'
''db = "data/urlcount.asa"
'	'connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
'	connstr="driver={SQL Server};server=ADMINIST-0B8C59;uid=sa;pwd=admini;database=websen_6.0.1;"	
'Conn.open Connstr 

Function GetRs(Sql)
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.open Sql,Conn,1,1
	Set GetRs = Rs
End Function

Function UIRs(Sql)
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.open Sql,Conn,1,3
	Set UIRs = Rs
End Function

Function Fn_Dir(FilePath)
	for i=1 to len(FilePath)
	if left(right(FilePath,i),1)="/" or left(right(FilePath,i),1)="\" then
	  abc=i
	  exit for
	end if
	next
	if abc <> 1 then
	Fn_Dir=left(FilePath,len(FilePath)-abc+1)
	end if
end Function


	function Fn_IP(ip)
		ip=cstr(ip)
		ip1=left(ip,cint(instr(ip,".")-1))
		ip=mid(ip,cint(instr(ip,".")+1))
		ip2=left(ip,cint(instr(ip,".")-1))
		ip=mid(ip,cint(instr(ip,".")+1))
		ip3=left(ip,cint(instr(ip,".")-1))
		ip4=mid(ip,cint(instr(ip,".")+1))
		Fn_IP=cint(ip1)*256*256*256+cint(ip2)*256*256+cint(ip3)*256+cint(ip4)
	end function

'转译字符
	Function Fn_EnChar(body)
	'	body = Trim(body)
		body = Replace(body,CHR(38),"&#38;")
		body = replace(body,">","&gt;")
		body = replace(body,"<","&lt;")
		body = Replace(body,Chr(10),"<br>")
		body = Replace(body,Chr(13),"")
		
		body = Replace(body,CHR(34),"&quot;")
		body = Replace(body,CHR(39),"&#39;")
		body = Replace(body,CHR(32),"&nbsp;")
		Fn_EnChar = body
	End Function
'还原字符
	Function Fn_DeChar(body)
		body = replace(body,"&gt;",">")
		body = replace(body,"&lt;","<")
		body = Replace(body,"<br>",Chr(10))
		body = Replace(body,"",Chr(13))
		body = Replace(body,"&nbsp;",CHR(32))
		body = Replace(body,"&quot;",CHR(34))
		body = Replace(body,"&#39;",CHR(39))
		body = Replace(body,"&#38;",CHR(38))
		Fn_DeChar = body
	End Function
'
	
			
	Function RValue(vSql,v)
		Set wRs = UIRs(vSql)
		
		if wRs.eof then
			wRs.AddNew
			wRs("cv") = v
		end if
		
		wRs("cc") = wRs("cc")+1
		wRs.Update
		wRs.close
	End Function

	Function PageSplit(vI,vPageCount,cstate)
		if vI mod 10 = 0 then
			Sp = vI \ 10
		else
			Sp = vI \ 10 + 1
		end if
		Pagestart = (Sp-1)*10+1
		Pageend = Sp*10
		strSplit = "<table width=500 align=center><tr><td align=center>共"&vPageCount&"页 当前第"&vI&"页 &nbsp; &nbsp;<a href=index.asp?act="&cstate&"&AbsolutePage=1><font face=webdings title=第一页>9</font></a>&nbsp;"
		if Sp > 1 then strSplit = strSplit & "<a href=index.asp?act="&cstate&"&AbsolutePage="&Pagestart-10&"><font face=webdings title=前十页>7</font></a>&nbsp;"
		for j=PageStart to Pageend
			if j > vPageCount then exit for
			if j <> vI then
				strSplit = strSplit & "<a href=index.asp?act="&cstate&"&AbsolutePage="&j&">["&j&"]</a>&nbsp;"			
			else
				strSplit = strSplit & "<font color=red>["&j&"]</font>&nbsp;"
			end if
		next
		if Sp*10  < vPageCount then strSplit = strSplit & "<a href=index.asp?act="&cstate&"&AbsolutePage="&Pagestart+10&"><font face=webdings title=后十页>8</font></a>" 
		strSplit = strSplit & "<a href=index.asp?act="&cstate&"&AbsolutePage="&vPageCount&" ><font face=webdings title=""最后一页"">:</font></a></td></tr></table>"
		PageSplit = strSplit
End Function
sqlm="select * from Websen_worldec_master"
Set vRs = GetRs(sqlm)
User=vRs("Username")
userpawds=vRs("PassWord")
%>