<!--#include file="../../conn.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/check.asp"-->
<!--#include file="../../inc/md5.asp"-->
<%
Dim Asked_Setting,Point_Setting,Posts_Setting,NowUseTable
Dim AllPostTable
Dim AllPostTableName
Dim AskInstalDir
If CLng(NewAsp.BindDomain) = 0 Then
	AskInstalDir = Trim(NewAsp.InstallDir & NewAsp.ChannelDir)
Else
	AskInstalDir = Trim(NewAsp.DomainName & "/")
End If

If ChannelID=0 Then ChannelID=4
If Not ChkAdmin("Asked") Then
	Call Transfer_error()
End If

If Not IsObject(Ask_Conn) Then Ask_ConnectionDatabase

Sub DelAskedCahe(cName)
	Dim m_strAskedPath
	Dim cRs,iAskedKey
	If CLng(NewAsp.BindDomain) = 0 Then
		m_strAskedPath = Trim(NewAsp.InstallDir & NewAsp.ChannelDir)
	Else
		m_strAskedPath = Trim(NewAsp.DomainName & "/")
	End If
	Set cRs = NewAsp.Ask_Execute("SELECT id,AskedKey FROM [NC_Ask_Setup]")
	If Not (cRs.BOF And cRs.EOF) Then
		iAskedKey = md5(cRs("AskedKey"),16)
		Response.Write "<script language=""javascript"" src=""" & m_strAskedPath & "script/delcache.asp?key=" & iAskedKey & "&name=" & cName & """></script>"
	End If
	Set cRs = Nothing
End Sub
'--生成随机数函数
Function GetRandomCode(l)
	Randomize
	Dim m_strRandArray,m_intRandlen,m_strRandomize,i
	m_strRandArray = Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
	m_intRandlen = l '定义随机码的长度
	If m_intRandlen < 5 Then m_intRandlen = 16
	for i = 1 to m_intRandlen
		m_strRandomize = m_strRandomize & m_strRandArray(Int((21*Rnd)))
	next
	GetRandomCode = m_strRandomize
End Function

Sub AllPostTable1()
	Dim Trs
	Set Trs=NewAsp.Ask_Execute("SELECT * FROM [NC_Ask_TableList]")
	AllPostTable=""
	Do While Not TRs.EOF
		If AllPostTable=""  Then 
			AllPostTable=TRs("TableName")
			AllPostTableName=TRs("TableType")
		Else
			AllPostTable=AllPostTable&"|"&TRs("TableName")
			AllPostTableName=AllPostTableName&"|"&TRs("TableType")
		End If
	TRs.MoveNext
	Loop 
	Trs.Close
End Sub

Sub LoadAskSetup()
	Dim Rs,DataArry
	Set Rs=NewAsp.Ask_Execute("SELECT id,InstallDir,Asked_Setting,Point_Setting,Posts_Setting,NowUseTable FROM [NC_Ask_Setup]")
	DataArry=Rs.GetRows(1)
	Set Rs=Nothing
	If IsArray(DataArry) Then
		Asked_Setting = Split(DataArry(2,0),"|||")
		Point_Setting = Split(DataArry(3,0),"|||")
		Posts_Setting = Split(DataArry(4,0),"|||")
		NowUseTable = Trim(DataArry(5,0))
	End If
	DataArry=Null
End Sub

Call AllPostTable1()
AllPostTableName=Split(AllPostTableName,"|")
AllPostTable=Split(AllPostTable,"|")
%>
<script Language="JScript" runat="server">
//*************************************
//检测系统组件是否安装
//*************************************
function CheckObjInstalled(strClassString){
	try{
		var TmpObj = Server.CreateObject(strClassString);
		return true
	}catch(e){
		return false
	}
}
</script>