<%

Function gen_key(digits)
    dim char_array(80)
    For i = 0 To 9
        char_array(i) = CStr(i)
    Next
    For i = 10 To 35
        char_array(i) = Chr(i + 55)
    Next
    For i = 36 To 61
        char_array(i) = Chr(i + 61)
    Next
Randomize
do while len(output) < digits
        num = char_array(Int((62 - 0 + 1) * Rnd + 0))
        output = output & num
    loop
    gen_key    =    output
End Function

Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from config"
rs.open sql,conn,1,1
if not rs.eof then
C_no=rs("C_no")
D_version=rs("C_no")
C_title=rs("C_title")
C_keywords=rs("C_keywords")
C_content=rs("C_content")
C_code=rs("C_code")
C_wcode=rs("C_wcode")
C_wcodeC=rs("C_wcodeC")
C_fx=rs("C_fx")
C_fenxiang=rs("C_fenxiang")
C_qq=rs("C_qq")
C_mobile=rs("C_mobile")
C_qqon=rs("C_qqon")
C_mobileon=rs("C_mobileon")
C_wb=rs("C_wb")
C_swbid=rs("C_swbid")
C_twbid=rs("C_twbid")
C_search=rs("C_search")
C_member=rs("C_member")
C_shop=rs("C_shop")
C_foot=rs("C_foot")
C_logo=rs("C_logo")
C_logoC=rs("C_logoC")
C_logox=rs("C_logox")
C_logoy=rs("C_logoy")
C_fxP=rs("C_fxP")
C_btnP=rs("C_btnP")
C_music=rs("C_music")
C_cut=rs("C_cut")
C_email=rs("C_email")
C_mpwd=rs("C_mpwd")
C_qqid=rs("C_qqid")
C_qqkey=rs("C_qqkey")
end if
rs.close
set rs=nothing
'----------------------????????????,????????��???,??????????????----------------------
Sub CloseConn()
   conn.close()
   set conn=nothing
End Sub
'----------------------??????------------------------------
function filedelete(filepath)
Set fso = CreateObject("Scripting.FileSystemObject")      
fso.DeleteFile(Server.mappath(filepath))      
Set fso = nothing
end function

'-----------------------?????????-----------------------------
Function GetBody(D_domain) 
set https=server.createobject("microsoft.XMLHTTP")
If Err Then
Err.Clear
set https=server.createobject("MSXML2.XMLHTTP")
end if
With https 
.Open "Post", "http://www.flash-soul.com/domain/xml2.asp", False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send "D_domain="&D_domain
GetBody = .ResponseBody
End With 
GetBody = BytesToBstr(GetBody,"GB2312")
Set https = Nothing 
End Function

Function GetBody2(action,id) 
set https=server.createobject("microsoft.XMLHTTP")
If Err Then
Err.Clear
set https=server.createobject("MSXML2.XMLHTTP")
end if
With https 
.Open "Post", "http://www.flash-soul.com/far.asp", False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send "action="&action&"&id="&id
GetBody2 = .ResponseBody
End With 
GetBody2 = BytesToBstr(GetBody2,"utf-8")
Set https = Nothing 
End Function

Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText 
objstream.Close
set objstream = nothing
End Function

'----------------------SQL?????------------------------------
function Replace_Text(fString)
	if isnull(fString) then
		Replace_Text=""
		exit function
	else
		fString=trim(fString)
		fString=replace(fString,"'","''")
		fString=replace(fString,";","??")
		fString=replace(fString,"--","??")
		fString=server.htmlencode(fString)
		Replace_Text=fString
	end if	
end function

'----------------------???HTML???(???)------------------------------
Function LoseHtml(ContentStr)
  Dim ClsTempLoseStr,regEx
  ClsTempLoseStr = Cstr(ContentStr)
  Set regEx = New RegExp
  regEx.Pattern = "<\/*[^<>]*>"
  regEx.IgnoreCase = True
  regEx.Global = True
  ClsTempLoseStr = regEx.Replace(ClsTempLoseStr,"")
  LoseHtml = ClsTempLoseStr
  LoseHtml=replace(replace(replace(LoseHtml,chr(32),"") ,CHR(13),""),chr(10),"")
End function
'----------------------???HTML????????font??------------------------------

Function RemoveHTML(fString)
If fString<>"" Then
fString = trim(fString)
fString = replace(replace(fString,CHR(13),""),chr(10),"")
fString = Replace(fString,"	", "")
fString = Replace(fString,"../ueditor/", "ueditor/")
fString = Replace(fString,"../ueditor/", "ueditor/")
fString = Replace(fString,"http://", "http：//")
fString = Replace(fString,"style=""","")
fString = Replace(fString,":", "=""")
fString = Replace(fString,";""", ";")
fString = Replace(fString,";", """ ")
fString = Replace(fString,"font-size", "size")
fString = Replace(fString,"span", "font ")
fString = Replace(fString,"font-family", "face")
fString = Replace(fString,"strong>", "b>")
fString = Replace(fString,"em>", "i>")
fString = Replace(fString,"http：//", "http://")
fString = Replace(fString,"&nbsp""", "")


set re=new RegExp 
re.pattern="<(?!p|a|b|u|i|li|img|font|/p|/b|/a|/u|/li|/i|/img|/font).*?>" 
re.global=true 
fString=re.replace(fString,"") 

RemoveHTML = "<TEXTFORMAT LEADING='5'>"&fString&"</TEXTFORMAT>"
End If 
End Function 
function wapHTML(content)
content = Replace(content,"&nbsp;","")
content = replace(content,vbcrlf,"") 
content = replace(content,vbtab,"")
content = replace(content,"</p><p></p><p>","")
content = replace(content,"</p><p><br /></p><p>","")
wapHTML = content
end function

%>