<%
Function Conn_Path(DbConnFile,DbPath,DbName)
	Conn_Path="<" & "%" & vbcrlf
	Conn_Path=Conn_Path+"Dim DbConnFile,DbPath,DbName"& vbcrlf
	Conn_Path=Conn_Path+"DbConnFile=" & chr(34) & DbConnFile & chr(34) & "     ''数据库文件绝对路径，可以修改此文件名" & vbcrlf
	Conn_Path=Conn_Path+"DbPath=" & chr(34) & DbPath & chr(34) & "     '数据库目录名" & vbcrlf
	Conn_Path=Conn_Path+"DbName=" & chr(34) & DbName & chr(34) & "     '数据库名称！" & vbcrlf
	Conn_Path=Conn_Path+"%" & ">"
End Function
'****************************** 
'函数：ReNameFile(FolderPath,OldFile,NewFile) 
'参数：FolderPath-文件夹路径，OldFile-文件名，NewFile-新文件名 
'作者：www.melyysoft.com 
'日期：2008/5/16 
'描述：更改指定文件夹下文件名,当更改数据库名称时，必须先断开数据库连接!  
'****************************** 
Function ReNameFile(FolderPath,OldFile,NewFile)
	set fso=server.createobject("scripting.filesystemobject")
	if fso.fileexists(server.mappath(FolderPath)&"\"&OldFile) and fso.fileexists(server.mappath(FolderPath)&"\"&NewFile)=false then
		fso.getfile(server.mappath(FolderPath)&"\"&OldFile).name=NewFile
		ReNameFile=True
	elseif fso.fileexists(server.mappath(FolderPath)&"\"&NewFile) then
		Founderr=True
		ErrMsg=ErrMsg+"<li>New File Is Exit!"
		Exit Function
	else
		Founderr=True
		ErrMsg=ErrMsg+"<li>Old File Is Not Exit!"
		Exit Function
	end if
	set fso=nothing
End Function
'****************************** 
'函数：RenameFolder(FolderPath,OldFolder,NewFolder) 
'参数：FolderPath-文件夹路径，OldFolder-文件夹名，NewFolder-新文件夹名 
'作者：www.melyysoft.com 
'日期：2008/5/16 
'描述：更改指定文件夹下文件夹名  
'****************************** 
Function RenameFolder(FolderPath,OldFolder,NewFolder)
	set fso=server.createobject("scripting.filesystemobject")
	if fso.Folderexists(server.mappath(FolderPath)&"\"&OldFolder) and fso.Folderexists(server.mappath(FolderPath)&"\"&NewFolder)=false then
		fso.getfolder(server.mappath(FolderPath)&"\"&OldFolder).name=NewFolder
		RenameFolder=True
	elseif fso.folderexists(new_path) then
		Founderr=True
		ErrMsg=ErrMsg+"<li>Old Folder Is Not Exit!"
		Exit Function
	else
		Founderr=True
		ErrMsg=ErrMsg+"<li>Old Folder Is Not Exit!"
		Exit Function
	end if
	set fso=nothing
End Function
Function CreateFile(FilePath,Conn_Path)
	dim fso,hf
	set fso=Server.CreateObject("Scripting.FileSystemObject")
	set hf=fso.CreateTextFile(Server.mappath(FilePath),true) '创建文件
	hf.write Conn_Path
	hf.close:set hf=nothing
	set fso=nothing
End Function
'===================================================
'强制删除文件
'源码：FSO删除文件示例
'时间：2005年12月17日
'===================================================
Function DeleteFile(Filename)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath(filename)
on Error Resume Next
Fso.DeleteFile File, True '强制删除只读文件
If Err.Number = 53 Then
   sucmsg=sucmsg+"<li>"&filename&"文件不存在"
Elseif Err.Number = 70 Then
   sucmsg=sucmsg+"<li>"&filename&"文件为锁定状态"
Elseif Err.Number <> 0 Then
   sucmsg=sucmsg+"<li>未知错误，错误编码："&Err.Number&""
Else
   sucmsg=sucmsg+"<li>"&filename&"文件删除成功"
End If
set fso = nothing
End Function
'****************************** 
'函数：Generator(Length) 
'参数：Length,任意长度的数值，随机码位数 
'作者：www.melyysoft.com 
'日期：2008/5/16 
'描述：生成任意英文+数字位数+特殊字符长度的随机码函数  
'****************************** 
Function Generator(Length) 
 Dim i, tempS 
 tempS = "abcdefghijklmnopqrstuvwxyz1234567890#@%_$"  
 Generator = "" 
 If isNumeric(Length) = False Then  
  Exit Function  
 End If  
 For i = 1 to Length  
  Randomize  
  Generator = Generator & Mid(tempS,Int((Len(tempS) * Rnd) + 1),1) 
 Next  
End Function
'**************************************************
'函数名：IsValidStr
'作  用：检查字符是否在有效范围内
'参  数：str ----要检查的字符
'返回值：True  ----字符合法
'        False ----字符不合法
'**************************************************
Function IsValidStr(ByVal str)
    Dim i, c
	IsValidStr = True
    For i = 1 To Len(str)
        c = LCase(Mid(str, i, 1))
        If InStr("abcdefghijklmnopqrstuvwxyz", c) <= 0 and InStr("1234567890", c) <= 0 Then
            IsValidStr = False
            Exit Function
        End If
    Next
End Function

Function CheckFolderExist(FolderName) 
set fso=Server.CreateObject ("Scripting.FileSystemObject")  
if fso.FileExists(server.MapPath (FolderName)) then 
	CheckFolderExist=True
else 
	CheckFolderExist=False 
end if
set fso=nothing
End Function	
%>