<!--#include file=config.asp-->
<%
	Response.Buffer = True 
	Response.ExpiresAbsolute = Now() - 1 
	Response.Expires = 0 
	Response.CacheControl = "no-cache" 
	Response.AddHeader "Pragma", "no-cache"
	Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
'--------------------------------------------------------------------------

Dim rs,Conn,conn2
	
On Error Resume Next



YD_SQL_SERVERIP=""&YD_SQL_SERVERIP1&""   '数据库IP或数据库服务名
YD_SQL_UserName=""&YD_SQL_UserName1&""          '登录数据库用户名
YD_SQL_PassWord=""&YD_SQL_PassWord1&""         '登录数据库密码
YD_Main_DatabaseName=""&YD_Main_DatabaseName1&"" '主数据库名


On Error Resume Next
set conn=server.createobject("ADODB.connection")


if dateSQL1="0" then    '数据库方式，1为access，0为sql


conn.open "PROVIDER=SQLOLEDB;DATA SOURCE="&YD_SQL_SERVERIP&";UID="&YD_SQL_UserName&";PWD="&YD_SQL_PassWord&";DATABASE="&YD_Main_DatabaseName




else
conn.open"Driver={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath(""&acc1&"")
'Conn.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & accdate
end if


	'采集数据联接
	set Conn2=Server.CreateObject ("Adodb.Connection")
	Conn2.Open "provider=microsoft.jet.oledb.4.0;" & "data source = " & server.mappath("saytkpic_xyzj.mdb")




'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错，请检查连接字符串。"
Response.End
End If
On Error GoTo 0

function strlogin(str)
if str="" or isnull(str) then
	strlogin=str
	exit function
end if
strlogin = replace(str,"&","")
strlogin = replace(strlogin,"%","")
strlogin = replace(strlogin,chr(34),"")
strlogin = replace(strlogin,"=","")
strlogin = replace(strlogin," ","")
strlogin = replace(strlogin,"<","")
strlogin = replace(strlogin,">","")
strlogin = replace(strlogin,"(","")
strlogin = replace(strlogin,")","")
end function

function utf8(str)
if str="" or isnull(str) then
	utf8=str
	exit function
end if
utf8 = replace(str,"&","&amp;")
utf8 = replace(utf8,"","&quot;")
utf8 = replace(utf8,"<","&lt;")
utf8 = replace(utf8,">","&gt;")
utf8 = replace(utf8," ","&nbsp;")
utf8 = replace(utf8,"$","$$")
utf8 = replace(utf8,"&#39;","'")
utf8 = replace(utf8,vbnewline,"<br/>")
end function


function CreateFolder(str)
dim UploadPath,Path,i,FSOObj
UploadPath=split(Replace(str,"\","/"),"/")
	Path = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
	Path=left(Path,instrrev(Path,"\" ) - 1 )
	path=path & "/../"

	for i=0 to ubound(UploadPath)
	if UploadPath(i)<>"" then
	path=path & UploadPath(i) & "/"
    	Set FsoObj=Server.CreateObject("Scripting.FileSystemObject")
	IF FSOObj.FolderExists(path) = False then
   	FsoObj.CreateFolder(path)
	end if
	Set FsoObj=Nothing
	end if
	next

end function

function CreateFile(str,Filepath)
dim txt,Path,FSO,fout
	txt=Replace(trim(str),chr(13)&chr(10),vbNewLine)

	Path = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
	Path=left(Path,instrrev(Path,"\" ) - 1 )
	path=path & "/../" & Filepath

	Set fso = Server.CreateObject("Scripting.FileSystemObject")
	IF FSO.FileExists(path) = False then
	Set fout = fso.Createtextfile(path,true)
	fout.write txt	'不换行
	'fout.writeline txt	'换行
	fout.close
	set fout=nothing
	end if
	set fso=nothing

end function


function DelFile(Filepath)
dim Path,FSO

	Path = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
	Path=left(Path,instrrev(Path,"\" ) - 1 )
	path=path & "/../" & Filepath

	Set fso = Server.CreateObject("Scripting.FileSystemObject")
	IF FSO.FileExists(path) = True then
   	Fso.deleteFile path,true
	end if
	set fso=nothing

end function

function DelFolder(Filepath)
dim Path,FSO

	Path = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
	Path=left(Path,instrrev(Path,"\" ) - 1 )
	path=path & "/../" & Filepath


    	Set FsoObj=Server.CreateObject("Scripting.FileSystemObject")
	IF FSOObj.FolderExists(path) = True then
   	FsoObj.deleteFolder path,true
	end if
	Set FsoObj=Nothing


end function

%>

<%  


sid=Request.querystring("sid")

saytk=Request.querystring("saytk")

dim rsqq,KEYid,keyuser
set rsqq=server.createobject("adodb.recordset")
'conn.Execute"Update twapp set ads6='"&sid_url()&"'"  
Sqlqq="select * from [adminguli] where sid='"&sid&"'"
rsqq.open sqlqq,conn,1,1
if rsqq.eof then 
response.redirect "../login.asp"
end if
if rsqq("sid")<>sid then 
response.redirect "../login.asp"
end if
KEYid=rsqq("ID")
keyuser=rsqq("username")
key=rsqq("key")
rsqq.close
set rsqq=Nothing
If KEYid<>1 Then
Response.Write "权限不足,只有站长才能管理"
Response.End
End if
%>
