function ASCIICoding(byteArray)
	dim i : i = 0
	dim returnString : returnString = ""
	dim tempLong : tempLong = 0
	for i = 1 to LenB(byteArray)
		tempLong = AscB(MidB(byteArray,i,1))
		if tempLong < &H80 then
			returnString = returnString & Chr(tempLong)
		else
			i = i + 1
			returnString = returnString & Chr(tempLong * &H100 + AscB(MidB(byteArray,i,1)))
		end if
	next
	ASCIICoding = returnString
end function

''''''''''''''''''''''''''''''''''''''''''''''''''
''名称:vbIsDate()
''作者:刘晖
''类型:Public
''参数:输入		strDate		string		原字符串
''     输出		是否是日期型
''说明:将VBScript函数封装
''''''''''''''''''''''''''''''''''''''''''''''''''
function vbIsDate(expression)
	vbIsDate = IsDate(expression)
end function

function vbDateDiff(interval,date1,date2,firstdayofweek,firstdayofyear)
	vbDateDiff = DateDiff(interval,date1,date2,firstdayofweek,firstdayofyear)
end function

function vbFormatDateTime(expression,namedFormat)
	vbFormatDateTime = FormatDateTime(expression,namedFormat)
end function

function vbCBool(expression)
	vbCBool = CBool(expression)
end function

function vbNow()
	vbNow = Now()
end function

function JTrim(strInput)
	JTrim=trim(strInput)
end function
'-------------------------------------------------------------------------------------
'@功能：返回字符串，其中指定数目的某子字符串被替换为另一个子字符串
'@参数：expression 必选项。 字符串表达式 包含要替代的子字符串。  
'		find 必选项。被搜索的子字符串。 
'		replacewith 必选项。用于替换的子字符串。 
'@作者：黄岳
'-------------------------------------------------------------------------------------
Function VBReplace(expression, find, replacewith)
	if IsNull(expression) or IsNull(find) or IsNull(replacewith) then
		exit function 
	end if 
	VBReplace = Replace(expression, find, replacewith)
End Function


