asp实现检查目录是否存在与建立目录的函数_应用技巧

'-------------------------
'--检查目录是否存在
'----------------------
Function CheckDir(byval FolderPath)
    dim fso
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    If fso.FolderExists(Server.MapPath(folderpath)) then
    '存在
        CheckDir = True
    Else
    '不存在
        CheckDir = False
    End if
    Set fso = nothing
End Function

'-------------------------
'--建立目录
'----------------------
Function MakeNewsDir(byval foldername)
    dim fso
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
        fso.CreateFolder(Server.MapPath(foldername))
        If fso.FolderExists(Server.MapPath(foldername)) Then
           MakeNewsDir = True
        Else
           MakeNewsDir = False
        End If
    Set fso = nothing
End Function

时间: 2024-08-04 10:59:42

asp实现检查目录是否存在与建立目录的函数_应用技巧的相关文章

asp中判断服务器是否安装了某种组件的函数_应用技巧

判断服务器是否安装了某种asp组件,比较常用的代码如下: 复制代码 代码如下: <% '功能:检查是否存在系统组件或组件是否安装成功 '参数:组件名 Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then IsO

asp中去除内容HTML标签的三个function函数_应用技巧

复制代码 代码如下: '============================== '功能描述: 用正则除去HTML标记 '不能保留<b><strong>等以及用户自定义的<和> '============================== Function RemoveHTMLTag(fString)         Dim re         Set re = New RegExp         re.IgnoreCase = True         re

asp中向文本框输出数据原样式的函数_应用技巧

从数据库输出信息时有转换函数,可以将回车空格按原样式输出.这段代码可向文本框原样输出代码. 复制代码 代码如下: Function cc_f_textarea_html_encode(cc_f_t_h_e_str)  If Not IsNull(cc_f_t_h_e_str) And cc_f_t_h_e_str <> "" Then  cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, ">", ">

asp下用datediff实现计算两个时间差的函数_应用技巧

计算两个时间差的函数 '****************************** '||Function TimeDiff(sBegin, sEnd) '||本函数计算两个时间的差,可以不用更改直接使用 '||作者:machinecat 2001/10/26 '****************************** '****************************** '注:首先需要判断用户输入的sBegin与sEnd之间的大小 '可以通过DataDiff函数获得两者之间的时

ASP 递归调用 已知节点查找根节点的函数_应用技巧

复制代码 代码如下: Function getTreeRootId(pNodeId) getSQL = "select note_id,parent_id from [T_tree_demo] where note_id='"& pNodeId &"'" Set getRs = db.Execute(getSQL) If Not getRs.eof Then If Trim(getRs("parent_id")) = "

asp.net中MD5 16位和32位加密函数_实用技巧

public string md5(string str,int code)   {    if(code==16) //16位MD5加密(取32位加密的9~25字符)    {     return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(8,16) ;    }     else//32位加密    {     

asp 取得中文句子头一个字的大写拼音字母的函数_应用技巧

取得中文句子头一个字的大写拼音字母<% '****************************** '函数:getpychar(char) '参数:char,任意中文字符或句子 '作者:阿里西西 '日期:2007/7/15 '描述:取得中文句子头一个字的大写拼音字母 '示例:getpychar("欢迎访问阿里西西") '****************************** Function getpychar(char)  Dim tmp  tmp=65536+Asc

asp实现检查目录是否存在与建立目录的函数

'------------------------- '--检查目录是否存在 '---------------------- Function CheckDir(byval FolderPath)     dim fso     Set fso = Server.CreateObject("Scripting.FileSystemObject")     If fso.FolderExists(Server.MapPath(folderpath)) then     '存在      

asp伪静态情况下实现的utf-8文件缓存实现代码_应用技巧

复制代码 代码如下: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.CodePage=65001%> <% Response.Charset="UTF-8" %> <% '该程序通过使用ASP的FSO功能,减少数据库的读取.经测试,可以减少90%的服务器负荷.页面访问速度基本与静态页面相当. '使用方法:将该文件放在网站里,然后在需要引用的文件