권장 : ASP 개발에서 유용한 기능 모음 (3) ASP 개발에서 유용한 기능 모음이 매우 유용합니다. 보관하십시오! '*************************************** 'Slice content-Split by line'****************************** Function SplitLines(byVal Content,byVal ContentNums) Dim ts,i,l ContentNums=int(
ASP 개발에서 유용한 기능 모음이 매우 유용합니다. 보관하십시오!
'**************************************
'필터 하이퍼 링크
'**************************************
기능 checkurl (byval chkstr)
Dim Str : str = chkstr
str = trim (str)
iSnull (str)이면
CheckUrl =
종료 기능
끝 If
희미한 re
RE = New Regexp를 설정합니다
re.ignorecase = true
re.global = true
re.pattern = (d) (ocument/.cookie)
str = re.replace (str, 1ocument 쿠키)
re.pattern = (d) (ocument/.write)
str = re.replace (str, 1ocument write)
re.pattern = (s) (스크립트 :)
str = re.replace (str, 1script)
Re.Pattern = (S) (스크립트)
str = re.replace (str, 1script)
re.pattern = (O) (bject)
str = re.replace (str, 1bject)
re.pattern = (a) (pplet)
str = re.replace (str, 1pplet)
re.pattern = (e) (mbed)
str = re.replace (str, 1mbed)
RE = 아무것도 설정하지 않습니다
str = replace (str,>,>)
str = replace (str, <, <)
CheckUrl = str
엔드 기능
'**************************************
'필터 파일 이름
'**************************************
함수 fixName (upfileext)
isempty (upfileext) 인 경우 함수를 종료하십시오
fixname = ucase (upfileext)
fixName = replace (fixName, chr (0),)
fixName = replace (fixName,.,)
fixName = replace (fixName, ASP,)
fixName = replace (fixName, ASA,)
fixName = replace (fixName, aspx,)
fixName = replace (fixName, cer,)
fixName = replace (fixName, cdx,)
fixName = replace (fixName, htr,)
엔드 기능
'**************************************
'특수 문자 필터
'**************************************
함수 checkstr (byval chkstr)
Dim Str : str = chkstr
iSnull (str)이면
checkstr =
종료 기능
끝 If
str = replace (str, &, &)
str = replace (str, ',')
str = replace (str ,,)
희미한 re
RE = New Regexp를 설정합니다
re.ignorecase = true
re.global = true
Re.Pattern = (W) (여기)
str = re.replace (str, 1here)
re.pattern = (s) (선거)
str = re.replace (str, 1elect)
re.pattern = (i) (nsert)
str = re.replace (str, 1nsert)
re.pattern = (c) (Reate)
str = re.replace (str, 1reate)
Re.Pattern = (D) (ROP)
str = re.replace (str, 1rop)
re.pattern = (a) (lter)
str = re.replace (str, 1lter)
re.pattern = (d) (Elete)
str = re.replace (str, 1elete)
re.pattern = (u) (pdate)
str = re.replace (str, 1pdate)
re.pattern = (/s) (또는)
str = re.replace (str, 1or)
RE = 아무것도 설정하지 않습니다
checkstr = str
엔드 기능
'**************************************
'특수 문자를 복원하십시오
'**************************************
함수 UnCheckstr (Byval str)
iSnull (str)이면
UnCheckstr =
종료 기능
끝 If
str = replace (str, ',')
str = replace (str ,,)
희미한 re
RE = New Regexp를 설정합니다
re.ignorecase = true
re.global = true
Re.Pattern = (W) (여기)
str = re.replace (str, 1here)
re.pattern = (s) (선거)
str = re.replace (str, 1elect)
re.pattern = (i) (nsert)
str = re.replace (str, 1nsert)
re.pattern = (c) (Reate)
str = re.replace (str, 1reate)
Re.Pattern = (D) (ROP)
str = re.replace (str, 1rop)
re.pattern = (a) (lter)
str = re.replace (str, 1lter)
re.pattern = (d) (Elete)
str = re.replace (str, 1elete)
re.pattern = (u) (pdate)
str = re.replace (str, 1pdate)
re.pattern = (/s) (또는)
str = re.replace (str, 1or)
RE = 아무것도 설정하지 않습니다
str = replace (str, &, &)
Uncheckstr = str
엔드 기능
'**************************************
'HTML 코드를 변환합니다
'**************************************
함수 htmlencode (Byval Retring)
Dim Str : str = Retring
그렇지 않다면 (str)
str = replace (str,>,>)
str = replace (str, <, <)
str = replace (str, chr (9),)
str = replace (str, chr (32),)
str = replace (str, chr (39), ')
str = replace (str, chr (34),)
str = replace (str, chr (13),)
str = replace (str, chr (10), <br/>)
htmlencode = str
끝 If
엔드 기능
'**************************************
'역 변환 HTML 코드
'**************************************
함수 htmldecode (Byval Retring)
Dim Str : str = Retring
그렇지 않다면 (str)
str = replace (str,>,>)
str = replace (str, <, <)
str = replace (str ,, chr (9))
str = replace (str ,, chr (32))
str = replace (str, ', chr (39))
str = replace (str ,, chr (34))
str = replace (str ,, chr (13))
str = replace (str, <br/>, chr (10))
htmldecode = str
끝 If
엔드 기능
'**************************************
'복구 및 캐릭터
'**************************************
함수 clearhtml (byval Retring)
Dim Str : str = Retring
그렇지 않다면 (str)
str = replace (str, &, &)
clearhtml = str
끝 If
엔드 기능
'**************************************
'필터 Textarea
'**************************************
기능 ubbfilter (Byval Retring)
Dim Str : str = Retring
그렇지 않다면 (str)
str = replace (str, </textarea>, </textarea>)
ubbfilter = str
끝 If
엔드 기능
'**************************************
'필터 HTML 코드
'**************************************
기능 editdehtml (byval 컨텐츠)
editdehtml = 컨텐츠
그렇지 않다면 (editdehtml)
editdehtml = uncheckstr (editdehtml)
editdehtml = replace (editdehtml, &, &)
editdehtml = replace (editdehtml, <, <)
editdehtml = replace (editdehtml,>,>)
editdehtml = replace (editdehtml, chr (34),)
editdehtml = replace (editdehtml, chr (39), ')
끝 If
엔드 기능
'**************************************
'날짜 변환 기능
'**************************************
함수 dateToStr (dateTime, showType)
Dim Datemonth, Dateday, Datehour, Dateminute, DateWeek, DateSecond
Fullweekday, Shortweekday, Fullmonth, Shortmonth, Timezone1, Timezone2
TimeZone1 =+0800
TimeZone2 =+08 : 00
Fullweekday = 배열 (일요일, 월요일, 화요일, 수요일, 금요일, 토요일)
Shortweekday = 배열 (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
FullMonth = 배열 (1 월, 2 월, 3 월, 4 월, 5 월, 6 월, 7 월, 9 월, 9 월, 10 월, 12 월)
Shortmonth = 배열 (1 월, 2 월, 3 월, 4 월, 5 월, Jun, 7 월, 8 월, 9 월, 10 월, 11 월, 12 월)
Datemonth = Month (DateTime)
Dateday = day (dateTime)
Datehour = Hour (DateTime)
dateminute = minute (dateTime)
dateweek = 주중 (dateTime)
날짜 = 두 번째 (dateTime)
len (datemonth) <2 인 경우 datemonth = 0 & datemonth
Len (Dateday) <2 인 경우 Dateday = 0 & Dateday
LEN (Dateminute) <2 인 경우 Dateminute = 0 & Dateminute
Case ShowType를 선택하십시오
케이스 YMD
dateToStr = Year (dateTime)-& datemonth- & dateday
사례 YMD H : IA
희미한 dateampm
날짜가> 12 인 경우
날짜 = 데이트 하우 -12
dateampm = pm
또 다른
데이트 투어 = 데이트 쇼
dateampm = am
끝 If
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
DateToStr = Year (DateTime)-& Datemonth- & Dateday & Datehour : & dateminute & dateampm
사례 YMD H : I : S.
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
LEN (Datesecond) <2 인 경우 Datesecond = 0 & DateSecond
DateToStr = Year (DateTime)-& Datemonth- & Dateday & Datehour : & DateMinute : & DateSecond
ymdhis
날짜 = 두 번째 (dateTime)
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
LEN (Datesecond) <2 인 경우 Datesecond = 0 & DateSecond
DateToStr = Year (DateTime) & Datemonth & Dateday & DateHour & DateMinute & DateSecond
CASE YM
dateToStr = right (연도 (dateTime), 2) & datemonth
사례 d
dateToStr = Dateday
케이스 YMD
DateToStr = Right (Year (DateTime), 4) 및 Datemonth & Dateday
사례 mdy
희미한 데이
사례 날짜를 선택하십시오
사례 1
dayend = st
사례 2
dayend = nd
사례 3
dayend = rd
다른 경우
dayend = th
종료 선택
datetoStr = fullmonth (datemonth-1) & Dateday & Dayend & Right (Year (DateTime), 4)
사례 W, DMY H : I : S.
날짜 = 두 번째 (dateTime)
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
LEN (Datesecond) <2 인 경우 Datesecond = 0 & DateSecond
datetoStr = shortweekday (dateweek-1), & dateday & left (fullmonth (datemonth-1), 3) & Right (Year (DateTime), 4) & Dateminute : & DateSecond & Timezone1
사례 ym-dth : i : s
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
LEN (Datesecond) <2 인 경우 Datesecond = 0 & DateSecond
DateToStr = Year (DateTime)-& Datemonth- & Datedayt & Dathhour : & Dateminute : & DateSecond & Timezone2
다른 경우
LEN (DATHHOUR) <2 인 경우 데이트 쇼 = 0 및 데이트 쇼
DateToStr = Year (DateTime)-& Datemonth- & Dateday & Datehour : & Dateminute
종료 선택
엔드 기능
'**************************************
'페이지 매김 기능
'**************************************
Dim FirstShortcut, 바로 가기
FirstShortCut = false
함수 다중 지대 (숫자, 가포, 저작가, URL_ADD, Aname, 스타일)
CURPAGE = int (CURPAGE)
숫자 = int (숫자)
희미한 URL
url = request.servervariables (script_name) & url_add
멀티 지 =
희미한 페이지, 오프셋, pagei
'int (숫자)> int (Perpage)라면
페이지 = 9
오프셋 = 4
Dim Pages, FromPage, Topage
숫자 mod cint (perpage) = 0이면
pages = int (숫자/perpage)
또 다른
pages = int (숫자/perpage) +1
끝 If
FromPage = Curpage-Offset
Topage = Curpage+Page-Offset-1
Page> 페이지 인 경우
Frompage = 1
Topage = 페이지
또 다른
Frompage <1이면 1
Topage = CURPAGE+1-FROMPAGE
Frompage = 1
if (topage-frompage) <page and (topage-frompage) <pages topage = page
elseif topage> 페이지
FromPage = CURPAGE PAGE +TOPAGE
Topage = 페이지
if (topage-frompage) <page and (topage-frompage) <pages wrompage = pages-page+1
끝 If
끝 If
multipage = <div class = page style = & style> <ul>
'Curpage <> 1이면 multipage = multipage & <li class = pagel> <a href = & url & page = 1 class = pagelbutton title = First Page> </a> </li>
multipage = multipage <li class = pagenumber>
CUPAGE <> 1이면 multipage = multipage <a href = & urlpage = 1 title = 첫 페이지 스타일 = 텍스트-설명 : 없음> <</a> |
FirstShortCut이 아닌 경우 바로 가기 = accesskey =, else 바로 가기 =입니다
Curpage <> 1 인 경우 Multipage = multipage <a href = & urlpage = & curpage-1 title = previous pagestyle = text-decoration : none; & shortcut> </a>
pagei = page에서 토폴리지까지
Pagei <> 저작품이라면
multipage = multipage <a href = & urlpage = & pagei & aname> & pagei </a> |
또 다른
Multipage = multipage <strong> & pagei </strong>
pagei <> pages 인 경우 multipage = multipage |
끝 If
다음
FirstShortCut이 아닌 경우 바로 가기 = AccessKey =. 그렇지 않으면 바로 가기 =
CUPAGE <> Pages 인 경우 Multipage = multipage <a href = & urlpage = & curpage+1 title = next pagestyle = text-decoration : none & shortcut> </a>
Curpage <> Pages 인 경우 Multipage = multipage <a href = & urlpage = & pages & aname title = last page style = text-decoration : none >> </a>
멀티 지 = 멀티 지 </li>
'int (pages)> int (페이지)이면
'multipage = multipage & <li> ... </li> <li> <a href = & url & page = & pages & aname &> & pages & </a> </li>
'끝 If
'Curpage <> Pages라면 multipage = multipage & <li class = pager> <a href = & url & page = & aname & class = pagerbutton title = last page> </a> </li>
multipage = multipage </ul> </div>
'끝 If
FirstShortCut = true
엔드 기능
공유 : 데이터베이스 값이 비어 있는지 확인하기위한 ASP의 일반적인 기능 다양한 필드의 다른 특성으로 인해 필드가 비어 있는지 확인하는 방법도 다릅니다. 다음은 일반적인 기능으로 필드 유형의 통증을 피합니다. '변수가 비어있는 기능이 아닌 기능 isblank (byref tempvar)'기본적으로 blank isblank = false '라고 가정하십시오.