FDS’s Blog

2009年7月30日

用ASP做在线升级文件

Filed under: ASP — 标签: — FDS @ 11:40

用ASP做在线升级文件的方法,方便用户升级。

<%
Rem #####################################################################################
Rem ## 在线升级类声明
Class Cls_oUpdate
  Rem #################################################################
  Rem ## 描述: ASP 在线升级类
  Rem ## 版本: 1.0.0
  Rem ## 作者: 萧月痕
  Rem ## MSN:  xiaoyuehen(at)msn.com
  Rem ## 请将(at)以 @ 替换
  Rem ## 版权: 既然共享, 就无所谓版权了. 但必须限于网络传播, 不得用于传统媒体!
  Rem ## 如果您能保留这些说明信息, 本人更加感谢!
  Rem ## 如果您有更好的代码优化, 相关改进, 请记得告诉我, 非常谢谢!
  Rem #################################################################
  Public LocalVersion, LastVersion, FileType
  Public UrlVersion, UrlUpdate, UpdateLocalPath, Info
  Public UrlHistory
  Private sstrVersionList, sarrVersionList, sintLocalVersion, sstrLocalVersion
  Private sstrLogContent, sstrHistoryContent, sstrUrlUpdate, sstrUrlLocal
  Rem #################################################################
  Private Sub Class_Initialize()
   Rem ## 版本信息完整URL, 以 http:// 起头
   Rem ## 例: http://localhost/software/Version.htm
   UrlVersion     = “”
  
   Rem ## 升级URL, 以 http:// 起头, /结尾
   Rem ## 例: http://localhost/software/
   UrlUpdate     = “”
  
   Rem ## 本地更新目录, 以 / 起头, /结尾. 以 / 起头是为当前站点更新.防止写到其他目录.
   Rem ## 程序将检测目录是否存在, 不存在则自动创建
   UpdateLocalPath  = “/”
  
   Rem ## 生成的软件历史文件
   UrlHistory     = “history.htm”
  
   Rem ## 最后的提示信息
   Info        = “”
  
   Rem ## 当前版本
   LocalVersion    = “1.0.0″
  
   Rem ## 最新版本
   LastVersion    = “1.0.0″
  
   Rem ## 各版本信息文件后缀名
   FileType      = “.asp”
  End Sub
  Rem #################################################################
 
  Rem #################################################################
  Private Sub Class_Terminate()
 
  End Sub
  Rem #################################################################
  Rem ## 执行升级动作
  Rem #################################################################
  Public function doUpdate()
   doUpdate = False
  
   UrlVersion    = Trim(UrlVersion)
   UrlUpdate    = Trim(UrlUpdate)
  
   Rem ## 升级网址检测
   If (Left(UrlVersion, 7) <> “http://”) Or (Left(UrlUpdate, 7) <> “http://”) Then
    Info = “版本检测网址为空, 升级网址为空或格式错误(#1)”
    Exit function
   End If
  
   If Right(UrlUpdate, 1) <> “/” Then
    sstrUrlUpdate = UrlUpdate & “/”
   Else
    sstrUrlUpdate = UrlUpdate
   End If
  
   If Right(UpdateLocalPath, 1) <> “/” Then
    sstrUrlLocal = UpdateLocalPath & “/”
   Else
    sstrUrlLocal = UpdateLocalPath
   End If  
  
   Rem ## 当前版本信息(数字)
   sstrLocalVersion = LocalVersion
   sintLocalVersion = Replace(sstrLocalVersion, “.”, “”)
   sintLocalVersion = toNum(sintLocalVersion, 0)
  
   Rem ## 版本检测(初始化版本信息, 并进行比较)
   If IsLastVersion Then Exit function
  
   Rem ## 开始升级
   doUpdate = NowUpdate()
   LastVersion = sstrLocalVersion
  End function
  Rem #################################################################
 
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function IsLastVersion()
    Rem ## 初始化版本信息(初始化 sarrVersionList 数组)
    If iniVersionList Then
     Rem ## 若成功, 则比较版本
     Dim i
     IsLastVersion = True
     For i = 0 to UBound(sarrVersionList)
      If sarrVersionList(i) > sintLocalVersion Then
       Rem ## 若有最新版本, 则退出循环
       IsLastVersion = False
       Info = “已经是最新版本!”
       Exit For
      End If
     Next
    Else
     Rem ## 否则返回出错信息
     IsLastVersion = True
     Info = “获取版本信息时出错!(#2)”
    End If  
   End function
  Rem #################################################################
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function iniVersionList()
    iniVersionList = False
   
    Dim strVersion
    strVersion = getVersionList()
   
    Rem ## 若返回值为空, 则初始化失败
    If strVersion = “” Then
     Info = “出错…….”
     Exit function
    End If
   
    sstrVersionList = Replace(strVersion, ” “, “”)
    sarrVersionList = Split(sstrVersionList, vbCrLf)
   
    iniVersionList = True
   End function
  Rem #################################################################
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function getVersionList()
    getVersionList = GetContent(UrlVersion)
   End function
  Rem #################################################################
  Rem ## 开始更新
  Rem #################################################################
   Private function NowUpdate()
    Dim i
    For i = UBound(sarrVersionList) to 0 step -1
     Call doUpdateVersion(sarrVersionList(i))
    Next
    Info = “升级完成! <a href=”“” & sstrUrlLocal & UrlHistory & “”“>查看</a>”
   End function
  Rem #################################################################
 
  Rem ## 更新版本内容
  Rem #################################################################
   Private function doUpdateVersion(strVer)
    doUpdateVersion = False
   
    Dim intVer
    intVer = toNum(Replace(strVer, “.”, “”), 0)
   
    Rem ## 若将更新的版本小于当前版本, 则退出更新
    If intVer <= sintLocalVersion Then
     Exit function
    End If
   
    Dim strFileListContent, arrFileList, strUrlUpdate  
    strUrlUpdate = sstrUrlUpdate & intVer & FileType
   
    strFileListContent = GetContent(strUrlUpdate)
   
    If strFileListContent = “” Then
     Exit function
    End If
   
    Rem ## 更新当前版本号
    sintLocalVersion = intVer
    sstrLocalVersion = strVer
   
    Dim i, arrTmp
    Rem ## 获取更新文件列表
    arrFileList = Split(strFileListContent, vbCrLf)
   
    Rem ## 更新日志
    sstrLogContent = “”
    sstrLogContent = sstrLogContent & strVer & “:” & vbCrLf
   
    Rem ## 开始更新
    For i = 0 to UBound(arrFileList)
     Rem ## 更新格式: 版本号/文件.htm|目的文件
     arrTmp = Split(arrFileList(i), “|”)
     sstrLogContent = sstrLogContent & vbTab & arrTmp(1)
     Call doUpdateFile(intVer & “/” & arrTmp(0), arrTmp(1))    
    Next
   
    Rem ## 写入日志文件
    sstrLogContent = sstrLogContent & Now() & vbCrLf
    response.Write(“<pre>” & sstrLogContent & “</pre>”)
    Call sDoCreateFile(Server.MapPath(sstrUrlLocal & “Log” & intVer & “.htm”), _
                                          “<pre>” & sstrLogContent & “</pre>”)
    Call sDoAppendFile(Server.MapPath(sstrUrlLocal & UrlHistory), “<pre>” & _
                                          strVer & “_______” & Now() & “</pre>” & vbCrLf)
   End function
  Rem #################################################################
 
  Rem ## 更新文件
  Rem #################################################################
   Private function doUpdateFile(strSourceFile, strTargetFile)
    Dim strContent
    strContent = GetContent(sstrUrlUpdate & strSourceFile)
   
    Rem ## 更新并写入日志
    If sDoCreateFile(Server.MapPath(sstrUrlLocal & strTargetFile), strContent) Then    
     sstrLogContent = sstrLogContent & “  成功” & vbCrLf
    Else
     sstrLogContent = sstrLogContent & “  失败” & vbCrLf
    End If
   End function
  Rem #################################################################
  Rem ## 远程获得内容
  Rem #################################################################
   Private function GetContent(strUrl)
    GetContent = “”
   
    Dim oXhttp, strContent
    Set oXhttp = Server.CreateObject(“Microsoft.XMLHTTP”)
    ‘On Error Resume Next
    With oXhttp
     .Open “GET”, strUrl, False, “”, “”
     .Send
     If .readystate <> 4 Then Exit function
     strContent = .Responsebody
    
     strContent = sBytesToBstr(strContent)
    End With
   
    Set oXhttp = Nothing
    If Err.Number <> 0 Then
     response.Write(Err.Description)
     Err.Clear
     Exit function
    End If
   
    GetContent = strContent
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sBytesToBstr(vIn)
    dim objStream
    set objStream = Server.CreateObject(“adodb.stream”)
    objStream.Type    = 1
    objStream.Mode    = 3
    objStream.Open
    objStream.Write vIn
   
    objStream.Position  = 0
    objStream.Type    = 2
    objStream.Charset  = “GB2312″
    sBytesToBstr     = objStream.ReadText
    objStream.Close
    set objStream    = nothing
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sDoCreateFile(strFileName, ByRef strContent)
    sDoCreateFile = False
    Dim strPath
    strPath = Left(strFileName, InstrRev(strFileName, “\”, -1, 1))
    Rem ## 检测路径及文件名有效性
    If Not(CreateDir(strPath)) Then Exit function
    ‘If Not(CheckFileName(strFileName)) Then Exit function
   
    ‘response.Write(strFileName)
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Dim fso, f
    Set fso = CreateObject(“Scripting.FileSystemObject”)
    Set f = fso.OpenTextFile(strFileName, ForWriting, True)
    f.Write strContent
    f.Close
    Set fso = nothing
    Set f = nothing
    sDoCreateFile = True
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sDoAppendFile(strFileName, ByRef strContent)
    sDoAppendFile = False
    Dim strPath
    strPath = Left(strFileName, InstrRev(strFileName, “\”, -1, 1))
    Rem ## 检测路径及文件名有效性
    If Not(CreateDir(strPath)) Then Exit function
    ‘If Not(CheckFileName(strFileName)) Then Exit function
   
    ‘response.Write(strFileName)
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Dim fso, f
    Set fso = CreateObject(“Scripting.FileSystemObject”)
    Set f = fso.OpenTextFile(strFileName, ForAppending, True)
    f.Write strContent
    f.Close
    Set fso = nothing
    Set f = nothing
    sDoAppendFile = True
   End function
  Rem #################################################################
  Rem ## 建立目录的程序,如果有多级目录,则一级一级的创建
  Rem #################################################################
   Private function CreateDir(ByVal strLocalPath)
    Dim i, strPath, objFolder, tmpPath, tmptPath
    Dim arrPathList, intLevel
   
    ‘On Error Resume Next
    strPath     = Replace(strLocalPath, “\”, “/”)
    Set objFolder  = server.CreateObject(“Scripting.FileSystemObject”)
    arrPathList   = Split(strPath, “/”)
    intLevel     = UBound(arrPathList)
   
    For I = 0 To intLevel
     If I = 0 Then
      tmptPath = arrPathList(0) & “/”
     Else
      tmptPath = tmptPath & arrPathList(I) & “/”
     End If
     tmpPath = Left(tmptPath, Len(tmptPath) - 1)
     If Not objFolder.FolderExists(tmpPath) Then objFolder.CreateFolder tmpPath
    Next
   
    Set objFolder = Nothing
    If Err.Number <> 0 Then
     CreateDir = False
     Err.Clear
    Else
     CreateDir = True
    End If
   End function
  Rem #################################################################
  Rem ## 长整数转换
  Rem #################################################################
   Private function toNum(s, default)
    If IsNumeric(s) and s <> “” then
     toNum = CLng(s)
    Else
     toNum = default
    End If
   End function
  Rem #################################################################
End Class
Rem #####################################################################################
%>

ASP实现图片上传

Filed under: ASP — 标签:, — FDS @ 11:22

用纯ASP代码来实现图片的上传以及保存到数据库的功能(顺便也实现显示数据库中的图片到网页上的功能)。
  首先我们先来熟悉一下将要使用的对象方法。我们用来获取上一个页面传递过来的数据一般是使用Request对象。同样的,我们也可以使用Request对象来获取上传上来的文件数据,使用的方法是Request.BinaryRead()。而我们要从数据库中读出来图片的数据显示到网页上面要用到的方法是:
Request.BinaryWrite()。在我们得到了图片的数据,要保存到数据库中的时候,不可以直接
使用Insert语句对数据库进行操作,而是要使用ADO的AppendChunk方法,同样的,读出数据库
中的图片数据,要使用GetChunk方法。各个方法的具体语法如下:
*Request.BinaryRead语法:
variant=Request.BinaryRead(count)
参数
variant
返回值保存着从客户端读取到数据。
count
指明要从客户端读取的数据量大小,这个值小于或者等于使用方法Request.TotalBytes得到的
数据量。
*Request.BinaryWrite语法:
Request.BinaryWritedata
参数
data
要写入到客户端浏览器中的数据包。
*Request.TotalBytes语法:
variant=Request.TotalBytes
参数
variant
返回从客户端读取到数据量的字节数。
*AppendChunk语法
将数据追加到大型文本、二进制数据Field或Parameter对象。
object.AppendChunkData
参数
objectField或Parameter对象
Data变体型,包含追加到对象中的数据。
说明
使用Field或Parameter对象的AppendChunk方法可将长二进制或字符数
  据填写到对象中。在系统内存有限的情况下,可以使用AppendChunk方法对长整型值进行
部分而非全部的操作。
*GetChunk语法
返回大型文本或二进制数据Field对象的全部或部分内容。
variable=field.GetChunk(Size)
返回值
返回变体型。
参数
Size长整型表达式,等于所要检索的字节或字符数。
说明
  使用Field对象的GetChunk方法检索其部分或全部长二进制或字符数据。在系统内存有限
的情况下,可使用GetChunk方法处理部分而非全部的长整型值。
GetChunk调用返回的数据将赋给“变量”。如果Size大于剩余的数据,则
GetChunk仅返回剩余的数据而无需用空白填充“变量”。如果字段为空,则
GetChunk方法返回Null。
  每个后续的GetChunk调用将检索从前一次GetChunk调用停止处开始的数据。但是,如果从
一个字段检索数据然后在当前记录中设置或读取另一个字段的值,ADO将认为已从第一个字段
中检索出数据。如果在第一个字段上再次调用GetChunk方法,ADO将把调用解释为新的GetChu
nk操作并从记录的起始处开始读取。如果其他Recordset对象不是首个Recordset对象的副本,
则访问其中的字段不会破坏GetChunk操作。
如果Field对象的Attributes属性中的adFldLong位设置为True,则可以对该字段使用GetChun
k方法。
如果在Field对象上使用Getchunk方法时没有当前记录,将产生错误3021(无当前记录)。
  接下来,我们就要来设计我们的数据库了,作为测试我们的数据库结构如下(access200
0):

字段名称    类型    描述
  id   自动编号   主键值
    img          OLE对象   用来保存图片数据 

对于在MSSQLServer7中,对应的结构如下:
字段名称    类型    描述
  id    int(Identity)        主键值
     img      image             用来保存图片数据 

现在开始正式编写我们的纯ASP代码上传部分了,首先,我们有一个提供给用户的上传界面
,可以让用户选择要上传的图片。代码如下
(upload.htm):
<html>
<body>
<center>
<form name=”mainForm” enctype=”multipart/form-data” action=”process.asp” method=p
ost>
  <inputtype=filename=mefile><br>
  <inputtype=submitname=okvalue=”OK”>
</form>
</center>
</body>
</html>
注意enctype=”multipart/form-data”,一定要在Form中有这个属性,否则,将无法得到上传
上来的数据。接下来,我们要在process.asp中对从浏览器中获取的数据进行必要的处理,因
为我们在process.asp中获取到的数据不仅仅包含了我们想要的上传上来的图片的数据,也包
含了其他的无用的信息,我们需要剔除冗余数据,并将处理过的图片数据保存到数据库中,这
里我们以access2000为例。具体代码如下(process.asp):
<%
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13)&chrB(10)
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf&bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
setconnGraph=server.CreateObject(“ADODB.connection”)
connGraph.ConnectionString=”driver={MicrosoftAccessDriver(*.mdb)};DBQ=”&server.Ma
pPath(“images.mdb”)&”;uid=;PWD=;”
connGraph.Open
setrec=server.createobject(“ADODB.recordset”)
rec.Open”SELECT*FROM[images]whereidisnull”,connGraph,1,3
rec.addnew
rec(“img”).appendchunkmydata
rec.update
rec.close
setrec=nothing
setconnGraph=nothing
%>
好了,这下我们就把上传来的图片保存到了名为images.mdb的数据库中了,剩下的工作就是要
将数据库中的图片数据显示到网页上面了。一般在HTML中,显示图片都是使用<IMG>标签
,也就是<IMGSRC=”图片路径”>,但是我们的图片是保存到了数据库中,“图片路径”是什么
呢?呵呵,其实这个SRC属性除了指定路径外,也可以这样使用哦:
<IMGSRC=”showimg.asp?id=xxx”>
所以,我们所要做的就是在showimg.asp中从数据库中读出来符合条件的
数据,并返回到SRC属性中就可以了,具体代码如下(showimg.asp):
<%
setconnGraph=server.CreateObject(“ADODB.connection”)
connGraph.ConnectionString=”driver={MicrosoftAccessDriver(*.mdb)};DBQ=”&
server.MapPath(“images.mdb”)&”;uid=;PWD=;”
connGraph.Open
setrec=server.createobject(“ADODB.recordset”)
strsql=”selectimgfromimageswhereid=”&trim(request(“id”))
rec.openstrsql,connGraph,1,1
Response.ContentType=”image/*”
Response.BinaryWriterec(“img”).getChunk(7500000)
rec.close
setrec=nothing
setconnGraph=nothing
%>
注意在输出到浏览器之前一定要指定Response.ContentType=”image/*”,
以便正常显示图片。
最后要注意的地方是,我的process.asp中作的处理没有考虑到第一页(upload.htm)中还有其
他数据,比如<INPUT type=tesxt name=userid>等等,如果有这些项目,你的process.asp就
要注意处理掉不必要的数据。

在Asp程序中取得表单所有内容的方法

Filed under: ASP — 标签: — FDS @ 11:12

在Asp中如何得到所有表单的名称跟对应的值。其实,这个问题很简单,但是可能还是有很多人不知道该怎么做,所以特地写下来,仅供参考。在Asp程序中,用来获得客户端数据的对象是 Request,这个对象给我们提供了很多的方法以及属性。比如,有这样一个Form,

<FORM METHOD=POST name=cqq ACTION=”">
 <INPUT TYPE=”text” NAME=”username”>
 <INPUT TYPE=”text” NAME=”password”>
 <INPUT TYPE=”checkbox” NAME=”sex” value=”male”>
 <INPUT TYPE=”checkbox” NAME=”sex” value=”female”>
 <INPUT TYPE=”submit”>
 </FORM>

         如果我们要取得 username 中的值,我们可以这样写:Request.Form(“username”)

 这个大家都会,其实这个Form是一个集合,也就是说表单中的所有的内容都存放在这个集合

当中,我们要取得某个元素的值,只需要在Request.Form() 这里制定元素的名称就可以了,比如

上面的username。

          那么,我们要取得集合中所有的值呢?  那很简单,什么都不用跟就是了,直接写Request.Form

就得到了集合中所有元素的名称跟值。  下面是一个对集合操作的语句:

<%
For each obj in Request.Form
     Response.write obj & ” ” & Request.Form(obj) &  ” <br>”
Next
%>

2009年6月24日

asp开发中textarea一些问题

Filed under: ASP — FDS @ 12:12

使用SQL SERVER的[导入]功能,便可将access数据转换,但要注意原来的’自增字段’需要修改,将相应字段标识修改为‘是’(原来的备注字段也会自动转化为ntext).

由于新闻的添加,修改都是通过使用textarea,首先为了能保留输入内容的格式,在处理添加的页面加入

<%
Function SqlStr( data )
SqlStr = “‘” & Replace( data, “‘”, “”” ) & “‘”
End Function
Function  coder(str)
Dim  i
If  IsNull(str)  Then  :  coder=”"  :  Exit  Function  :  End  If
For  i  =  1  to  Len(str)
Select  case  mid(str,i,1)
Case  “<”          :  coder  =  coder  &”&lt;”
Case  “>”          :  coder  =  coder  &”&gt;”
Case  “&”          :  coder  =  coder  &”&amp;”
Case  chr(9)    :  coder  =  coder  &”&nbsp;&nbsp;”
Case  VBCrLf    :  coder  =  coder  &”<br>”
Case  chr(32)  :  coder  =  coder  &”&nbsp;”
Case  chr(34)  :  coder  =  coder  &”&quot;”
Case  chr(39)  :  coder  =  coder  &”&#39;”
Case  Else        :  coder  =  coder  &  mid(str,i,1)
End  Select
Next
End  Function

content=request(“content”)’正文
content=replace(content,”&nbsp;”,” “)   ‘此处处理是因为修改页面所加入空格会被转化为&nbsp; ,在此先过滤
content=coder(content)

%>

在修改页面

<%

rs.Open sql, conn, adOpenStatic
content=rs(“正文”) ‘此处一定要写,倘若直接在textarea处写

‘<textarea rows=”7″ name=”t” cols=”47″ ><%=rs(“正文”) %></textarea >“则无法显示(我就被此处

‘困了好久,还以为长字段不能使用ntext而只能使用text或varchar呢)

%>

在显示页面

<%

rs.Open sql, conn, adOpenStatic
content=rs(“content”)   ‘一定先放到变量中,否则可能无法显示
content=replace(content,vbcrlf,”<br>”+vbcrlf)   ‘经过此处处理,可显示出正确的段落格式

%>

2009年5月11日

ASP控制每页打印行数的方法

Filed under: ASP — 标签:, , — FDS @ 18:12

在日常工作中,打印文档经常要使用,但是网页打印起来大部分都是不能控制的,这里分享一个用 ASP控制每页打印行数的方法。也许对你有一点点的启发哦!<%
pagenum=55′指定打印行数
%>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<TITLE>销售利润明细报表打印</TITLE>
<style type=”text/css”>
td {font-size:9pt; color:#000000}
A{text-decoration:none}
A:hover{color:#FF0000;text-decoration:derline}
.break{page-break-before:always}
</style>
</HEAD>
<script language=”javascript”>
window.print()
</script>
<BODY style=”border:none” topmargin=”0″ leftmargin=”6″ onload=”javascrpt:pagesetup_default();”>
<script language=”VbScript”>
dim hkey_root,hkey_path,hkey_key
hkey_root=”HKEY_CURRENT_USER”
hkey_path=”\Software\Microsoft\Internet Explorer\PageSetup”
function pagesetup_default()
    on error resume next
    Set RegWsh = CreateObject(“WScript.Shell”)
    hkey_key=”\header”   
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,”&b页&p/&P”
    hkey_key=”\footer”
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,”"
end function
</script>

<%
kdname1=trim(request(“kdname1″))
kdname2=trim(request(“kdname2″))
keyword1=trim(request(“keyword1″))
keyword2=trim(request(“keyword2″))

 if keyword1<>”" then
 today=keyword1
 else
 if kdname1=”" then
 today=year(date())&”-”&month(date())
 else
 today=kdname1&”至”&kdname2
 end if
 end if
%>
  <table border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center” width=”740″  height=”30″>
    <tr>
      <td align=”center”>销售利润汇总报表</td>
    </tr>
  </table>

<% 
 strSQL=”select autoid,sellautoid,productxili,productname,productsize,productnum,productdan,productjia,chaoshi,tiaoma,youhui,fukuan,moncount1,gongshang,lirun1,username,indate,fudate from sell where officename=’”&trim(request.cookies(“Myoffice”))&”‘ and monthjie=’0′ and (year(indate)=year(getdate()) and month(indate)=month(getdate())) and zhuofei is null order by autoid desc”            
 set rs1=server.createobject(“adodb.recordset”)             
 rs1.open strSQL,conn,1,1
%>              
  <table border=”1″ cellspacing=”0″ cellpadding=”0″ align=”center” style=”border-collapse: collapse”  bordercolor=”#000000″ width=”740″>            
    <tr>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”70″ >销售单号</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”168″ >商品名称(规格)</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”121″ >客户</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”30″ >数量</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”24″ >单位</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”50″ >销售价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”23″ >折%</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”52″ >进货价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”55″ >小计</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”45″ >利润</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”25″ >付款</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”61″ >销售日期</td>            
    </tr>
  </table>
<%            
  moncount2=0            
  moncount5=0            
  Do while not rs1.eof 
%>
<table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”740″ align=”center” style=”border-collapse:collapse; font-size:10pt;color:#000000″ bordercolor=”#000000″>
<%
for i=1 to pagenum
if not rs1.eof then
  if trim(rs1(“fukuan”))=”欠款” then            
  moncount6=Csng(rs1(“lirun1″))            
  moncount5=moncount5+moncount6            
  else            
  moncount3=Csng(rs1(“lirun1″))            
  moncount2=moncount2+moncount3            
  end if 
%>     
    <tr>            
      <td height=”18″ width=”70″>&nbsp;<%=rs1(“sellautoid”)%></td>            
      <td height=”18″ width=”168″><%=Decode(rs1(“productname”))%>&nbsp;<%=rs1(“productsize”)%></td>            
      <td height=”18″ width=”121″><%=left(rs1(“gongshang”),9)%></td>           
      <td height=”18″ width=”30″ align=”center”><%=rs1(“productnum”)%></td>           
      <td height=”18″ width=”24″ align=”center”><%=rs1(“productdan”)%></td>           
      <td height=”18″ width=”50″ align=”right”><%=formatNumber(rs1(“chaoshi”),varnum,-1)%></td>           
      <td height=”18″ width=”23″ align=”center”><%=rs1(“youhui”)%></td>           
      <td height=”18″ width=”52″ align=”right”><%=formatNumber(rs1(“productjia”),varnum,-1)%></td>           
      <td height=”18″ width=”55″ align=”right”><%=formatNumber(rs1(“moncount1″),varnum,-1)%></td>           
      <td height=”18″ width=”45″ align=”right”><%=formatNumber(rs1(“lirun1″),varnum,-1)%></td>           
      <td align=”center” height=”18″ width=”25″><%if trim(rs1(“fukuan”))=”欠款” then%><font color=blue><%=rs1(“fukuan”)%></font><%else%><%=rs1(“fukuan”)%><%end if%></td>           
      <td height=”18″ width=”61″><%=rs1(“indate”)%></td>           
    </tr>
<%
rs1.movenext
end if
next
%>
</table>
<%
if not rs1.eof and i=pagenum+1 then ‘添加分页标记
%>
  <div class=”break”>&nbsp;</div>
  <table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”740″ height=”12″ align=”center”><tr><td height=”12″></td></tr></table>
  <table border=”1″ cellspacing=”0″ cellpadding=”0″ align=”center” width=”740″ style=”border-collapse: collapse”  bordercolor=”#000000″>
    <tr>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”70″ >销售单号</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”168″ >商品名称(规格)</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”121″ >客户</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”30″ >数量</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”24″ >单位</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”50″ >销售价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”23″ >折%</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”52″ >进货价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”55″ >小计</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”45″ >利润</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”25″ >付款</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”61″ >销售日期</td>            
    </tr>
<%
end if
loop
rs1.close    
set rs1=nothing    
%> 
</table> 
  <table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”740″ height=”20″ align=”center” style=”border-collapse: collapse”  bordercolor=”#000000″>
    <tr>           
       <td><font color=”#FF0000″><b>现金利润:</b></font><b><%=formatNumber(moncount2,varnum,-1)%></b>&nbsp;&nbsp;&nbsp;<%if moncount5<>”" then%><b><font color=”#FF0000″>欠款利润</font>:<%=formatNumber(moncount5,varnum,-1)%></b><%end if%>&nbsp;&nbsp;&nbsp;<%if moncount5<>”" then%><b><font color=”#FF0000″>毛利合计:</font><%=formatNumber(moncount5+moncount2,varnum,-1)%></b><%end if%></td>           
     </tr>  
   </table>           
<%
end if
conn.close
set conn=nothing
%> 

</BODY>
</HTML>

2009年5月4日

ASP动态显示页面的锚链接

Filed under: ASP — 标签: — fangds @ 18:20

锚点是“top”,可以放在页面的任何位置,一般是页首。程序红色部分是关键,就是对锚点出现的判断,我设置的数值是4,意思是出现4个动态数据就出现一个锚点,少于4个时因为还在同一个页面,就不需要有锚点出现,这个数值可以根据实际情况进行修改。为了对页面进行进行美化,可以把锚点的文字用图形

 

<a name=”top”></a>

……(具体内容省略)

<%

While ((Repeat2__numRows <> 0) AND (NOT rsp.EOF))

%>

……(具体内容省略)

<%

  Repeat2__index=Repeat2__index+1

  Repeat2__numRows=Repeat2__numRows-1

  if Repeat2__numRows < 4 then

  Response.Write(“<table width=400 border=0 cellpadding=0 cellspacing=1><tr><td align=right><a href=#top>top</a></td></tr></table>”)

  else

  Response.Write(“<table width=400 border=0 cellpadding=0 cellspacing=1><tr><td align=right>a</td></tr></table>”)

  end if 

  rsp.MoveNext()

Wend

%>

2009年4月13日

3个步骤来实现asp模块化分页

Filed under: ASP — 标签: — FDS @ 22:40

 通过3个步骤来实现模块化分页,1、查询语句块,2、显示记录块,3、输出分页效果

1、查询语句块

<%
取得当前文件名
temp = Split(request.ServerVariables(“URL”), “/”)
fy = temp(UBound(temp))
set rs=server.createobject(“adodb.recordset”)
if not isempty(request(“page”)) then  
pagecount=cint(request(“page”))  
else  
pagecount=1  
end if
sql=”select  查询语句”
rs.open sql,conn,1,1
rs.pagesize=10  分页记录数
if pagecount>rs.pagecount or pagecount<=0 then             
pagecount=1             
end if            
if rs.eof and rs.bof then%>

<div align=”center” class=”001″><br>
对不起,没有符合搜索条件的记录!<br>
</div>

2、显示记录块

<%
else
rs.AbsolutePage=pagecount
do while not rs.eof %>

显示的记录

<% i=i+2                                                                                                 
rs.movenext                                                                                                 
if i>=rs.PageSize then exit do
loop                                                                   
%>

3、输出分页效果
<table width=”778″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
  <tr align=”center”>
    <% if rs.pagecount=1 then %>
    <td height=”35″ colspan=”4″ class=001><font color=”#000000″>共有[<font color="#ff0000"><%=rs.recordcount%></font>]条信息 当前显示第 <font color=”red”>1~<%=rs.recordcount%></font>条</font></td>
  </tr>
  <tr>
    <%else%>
    <td width=”19%” height=”35″ align=”center” valign=”middle” class=001><font color=”#000000″>
      <% page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
      page_end=rs.pagesize*pagecount
      if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
      共有[<font color="#ff0000"><%=rs.recordcount%></font>]信息</font></td>
    <td width=”58%” height=”30″ align=”center” class=”fy”><font color=”#000000″>
          <%
    if pagecount>5 and pagecount< rs.PageCount-5 and rs.pagecount>10 then
    qizu=pagecount-4
    min=pagecount+5
    response.write “<a href=”&source&”?page=1&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>首页</font></a>&nbsp;”
    response.write “<a href=”&source&”?page=”+cstr(pagecount-1)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>上一页</font></a>&nbsp;”                                                    
    for ipage=qizu to min
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    response.write “<a href=”&source&”?page=”+cstr(pagecount+1)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>下一页</font></a>&nbsp;”
    response.write “<a href=”&source&”?page=”+cstr(rs.PageCount)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>尾页</font></a>”
    end if
    if rs.PageCount<11 then
    for ipage=1 to rs.PageCount
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    end if
    if pagecount < 6 and rs.PageCount>10 then
    for ipage=1 to 10
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    response.write “<a href=”&source&”?page=”+cstr(rs.PageCount)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>尾页</font></a>”
    end if
    if pagecount>rs.PageCount-6 and rs.PageCount>10 then
    response.write “<a href=”&source&”?page=1&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>首页</font></a>&nbsp;”  
    for ipage=rs.PageCount-9 to rs.PageCount
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    end if
             %>
    </font></td><form name=go2to form method=Post action=<%=fy%>> 
    <td width=”13%” align=”center” valign=”middle” class=”fy”>                                         
   <input type=’hidden’ name=’sortid’ value=”<%=sortid%>”><input type=’hidden’ name=’typeid’ value=”<%=typeid%>”><input type=’hidden’ name=’qylb’ value=”<%=qylb%>”><input type=’hidden’ name=’title’ value=”<%title%>”><input type=’hidden’ name=’cityid’ value=”<%=cityid%>”><font color=’000064′> 转到第<input type=’text’ name=’page’ size=2 maxLength=3>
   页</font>                              
   </td>
    <td width=”10%” align=”center” valign=”middle” class=”fy”><input name=”image” type=’image’ onClick=check() value=’确 定’ src=’http://edu.chinaz.com/Get/Program/images/button_h.jpg’></td>
    </form>
  <tr>
    <td height=”20″ colspan=”6″ valign=”bottom”><font color=”#000000″>&nbsp; </font></td>
  </tr>
  <% end if %>
  <% end if %>
</table>

2009年4月2日

用ASP实现在服务器自动在线解压RAR文件

Filed under: ASP — FDS @ 09:58

文件打包以后,在服务器自动在线解压RAR文件,这样可以大量的减少上传文件的时间。也很方便!这里分享一个用ASP实现在服务器自动在线解压RAR文件的方法。

<%

dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso

Mlpath=”E:\page\mian\”    ‘存放RAR.EXE和CMD.EXE的路径

ylj=Server.mappath(“mian”)&”\”  ‘解压文件后所放的路径

ywj=Server.mappath(“mian\apathy.rar”)  ‘要解压的RAR文件

Set Shell = Server.CreateObject(“WScript.Shell”)

rarcomm= “E:\page\mian\cmd.exe /c “&Mlpath&”rar.exe x -t -o+ -p- ”

cmd=rarcomm&ywj&” “&ylj

RetCode = Shell.Run(cmd,1, True)

%>

就是用Server.CreateObject(“WScript.Shell”)来执行CMD.EXE来运行RAR.EXE文件来解压RAR文件的。

2009年3月5日

用ASP实现简单的防盗链

Filed under: ASP — FDS @ 10:22

是不是老有人盗用你的资源,自己辛苦搞的东西就被被人白白的盗用了。给你支个简单的防盗链方法,也许非常有用哦。主要实现方式是:判断来源地址是不是你的地址,如果是的话,给下载,如果不是,给出禁止提示!以下是简单代码部分,参考下吧。

<%
http=Request.ServerVariables(“HTTP_REFERER”)
http2=Cstr(Request.ServerVariables(“SERVER_NAME”))
if mid(http,8,len(http2))<>http2 then
response.write “本站禁止从外部站点下载!”
else
response.redirect “download.doc” ‘download.doc为下载文件名
end if
%>

用ASP把汉字转换成拼音的函数

Filed under: ASP — 标签:, — FDS @ 10:06

中国人都习惯于用拼音,常常把在SEO的时候,把URL的行字转化成拼音,有利于搜索引擎的识别,获的好的排名。这里分享一个用ASP把汉字转换成拼音的函数。希望各位看客喜欢!

<%
Set d = CreateObject(“Scripting.Dictionary”)
d.add ”a”,-20319
d.add ”ai”,-20317
d.add ”an”,-20304
d.add ”ang”,-20295
d.add ”ao”,-20292
d.add ”ba”,-20283
d.add ”bai”,-20265
d.add ”ban”,-20257
d.add ”bang”,-20242
d.add ”bao”,-20230
d.add ”bei”,-20051
d.add ”ben”,-20036
d.add ”beng”,-20032
d.add ”bi”,-20026
d.add ”bian”,-20002
d.add ”biao”,-19990
d.add ”bie”,-19986
d.add ”bin”,-19982
d.add ”bing”,-19976
d.add ”bo”,-19805
d.add ”bu”,-19784
d.add ”ca”,-19775
d.add ”cai”,-19774
d.add ”can”,-19763
d.add ”cang”,-19756
d.add ”cao”,-19751
d.add ”ce”,-19746
d.add ”ceng”,-19741
d.add ”cha”,-19739
d.add ”chai”,-19728
d.add ”chan”,-19725
d.add ”chang”,-19715
d.add ”chao”,-19540
d.add ”che”,-19531
d.add ”chen”,-19525
d.add ”cheng”,-19515
d.add ”chi”,-19500
d.add ”chong”,-19484
d.add ”chou”,-19479
d.add ”chu”,-19467
d.add ”chuai”,-19289
d.add ”chuan”,-19288
d.add ”chuang”,-19281
d.add ”chui”,-19275
d.add ”chun”,-19270
d.add ”chuo”,-19263
d.add ”ci”,-19261
d.add ”cong”,-19249
d.add ”cou”,-19243
d.add ”cu”,-19242
d.add ”cuan”,-19238
d.add ”cui”,-19235
d.add ”cun”,-19227
d.add ”cuo”,-19224
d.add ”da”,-19218
d.add ”dai”,-19212
d.add ”dan”,-19038
d.add ”dang”,-19023
d.add ”dao”,-19018
d.add ”de”,-19006
d.add ”deng”,-19003
d.add ”di”,-18996
d.add ”dian”,-18977
d.add ”diao”,-18961
d.add ”die”,-18952
d.add ”ding”,-18783
d.add ”diu”,-18774
d.add ”dong”,-18773
d.add ”dou”,-18763
d.add ”du”,-18756
d.add ”duan”,-18741
d.add ”dui”,-18735
d.add ”dun”,-18731
d.add ”duo”,-18722
d.add ”e”,-18710
d.add ”en”,-18697
d.add ”er”,-18696
d.add ”fa”,-18526
d.add ”fan”,-18518
d.add ”fang”,-18501
d.add ”fei”,-18490
d.add ”fen”,-18478
d.add ”feng”,-18463
d.add ”fo”,-18448
d.add ”fou”,-18447
d.add ”fu”,-18446
d.add ”ga”,-18239
d.add ”gai”,-18237
d.add ”gan”,-18231
d.add ”gang”,-18220
d.add ”gao”,-18211
d.add ”ge”,-18201
d.add ”gei”,-18184
d.add ”gen”,-18183
d.add ”geng”,-18181
d.add ”gong”,-18012
d.add ”gou”,-17997
d.add ”gu”,-17988
d.add ”gua”,-17970
d.add ”guai”,-17964
d.add ”guan”,-17961
d.add ”guang”,-17950
d.add ”gui”,-17947
d.add ”gun”,-17931
d.add ”guo”,-17928
d.add ”ha”,-17922
d.add ”hai”,-17759
d.add ”han”,-17752
d.add ”hang”,-17733
d.add ”hao”,-17730
d.add ”he”,-17721
d.add ”hei”,-17703
d.add ”hen”,-17701
d.add ”heng”,-17697
d.add ”hong”,-17692
d.add ”hou”,-17683
d.add ”hu”,-17676
d.add ”hua”,-17496
d.add ”huai”,-17487
d.add ”huan”,-17482
d.add ”huang”,-17468
d.add ”hui”,-17454
d.add ”hun”,-17433
d.add ”huo”,-17427
d.add ”ji”,-17417
d.add ”jia”,-17202
d.add ”jian”,-17185
d.add ”jiang”,-16983
d.add ”jiao”,-16970
d.add ”jie”,-16942
d.add ”jin”,-16915
d.add ”jing”,-16733
d.add ”jiong”,-16708
d.add ”jiu”,-16706
d.add ”ju”,-16689
d.add ”juan”,-16664
d.add ”jue”,-16657
d.add ”jun”,-16647
d.add ”ka”,-16474
d.add ”kai”,-16470
d.add ”kan”,-16465
d.add ”kang”,-16459
d.add ”kao”,-16452
d.add ”ke”,-16448
d.add ”ken”,-16433
d.add ”keng”,-16429
d.add ”kong”,-16427
d.add ”kou”,-16423
d.add ”ku”,-16419
d.add ”kua”,-16412
d.add ”kuai”,-16407
d.add ”kuan”,-16403
d.add ”kuang”,-16401
d.add ”kui”,-16393
d.add ”kun”,-16220
d.add ”kuo”,-16216
d.add ”la”,-16212
d.add ”lai”,-16205
d.add ”lan”,-16202
d.add ”lang”,-16187
d.add ”lao”,-16180
d.add ”le”,-16171
d.add ”lei”,-16169
d.add ”leng”,-16158
d.add ”li”,-16155
d.add ”lia”,-15959
d.add ”lian”,-15958
d.add ”liang”,-15944
d.add ”liao”,-15933
d.add ”lie”,-15920
d.add ”lin”,-15915
d.add ”ling”,-15903
d.add ”liu”,-15889
d.add ”long”,-15878
d.add ”lou”,-15707
d.add ”lu”,-15701
d.add ”lv”,-15681
d.add ”luan”,-15667
d.add ”lue”,-15661
d.add ”lun”,-15659
d.add ”luo”,-15652
d.add ”ma”,-15640
d.add ”mai”,-15631
d.add ”man”,-15625
d.add ”mang”,-15454
d.add ”mao”,-15448
d.add ”me”,-15436
d.add ”mei”,-15435
d.add ”men”,-15419
d.add ”meng”,-15416
d.add ”mi”,-15408
d.add ”mian”,-15394
d.add ”miao”,-15385
d.add ”mie”,-15377
d.add ”min”,-15375
d.add ”ming”,-15369
d.add ”miu”,-15363
d.add ”mo”,-15362
d.add ”mou”,-15183
d.add ”mu”,-15180
d.add ”na”,-15165
d.add ”nai”,-15158
d.add ”nan”,-15153
d.add ”nang”,-15150
d.add ”nao”,-15149
d.add ”ne”,-15144
d.add ”nei”,-15143
d.add ”nen”,-15141
d.add ”neng”,-15140
d.add ”ni”,-15139
d.add ”nian”,-15128
d.add ”niang”,-15121
d.add ”niao”,-15119
d.add ”nie”,-15117
d.add ”nin”,-15110
d.add ”ning”,-15109
d.add ”niu”,-14941
d.add ”nong”,-14937
d.add ”nu”,-14933
d.add ”nv”,-14930
d.add ”nuan”,-14929
d.add ”nue”,-14928
d.add ”nuo”,-14926
d.add ”o”,-14922
d.add ”ou”,-14921
d.add ”pa”,-14914
d.add ”pai”,-14908
d.add ”pan”,-14902
d.add ”pang”,-14894
d.add ”pao”,-14889
d.add ”pei”,-14882
d.add ”pen”,-14873
d.add ”peng”,-14871
d.add ”pi”,-14857
d.add ”pian”,-14678
d.add ”piao”,-14674
d.add ”pie”,-14670
d.add ”pin”,-14668
d.add ”ping”,-14663
d.add ”po”,-14654
d.add ”pu”,-14645
d.add ”qi”,-14630
d.add ”qia”,-14594
d.add ”qian”,-14429
d.add ”qiang”,-14407
d.add ”qiao”,-14399
d.add ”qie”,-14384
d.add ”qin”,-14379
d.add ”qing”,-14368
d.add ”qiong”,-14355
d.add ”qiu”,-14353
d.add ”qu”,-14345
d.add ”quan”,-14170
d.add ”que”,-14159
d.add ”qun”,-14151
d.add ”ran”,-14149
d.add ”rang”,-14145
d.add ”rao”,-14140
d.add ”re”,-14137
d.add ”ren”,-14135
d.add ”reng”,-14125
d.add ”ri”,-14123
d.add ”rong”,-14122
d.add ”rou”,-14112
d.add ”ru”,-14109
d.add ”ruan”,-14099
d.add ”rui”,-14097
d.add ”run”,-14094
d.add ”ruo”,-14092
d.add ”sa”,-14090
d.add ”sai”,-14087
d.add ”san”,-14083
d.add ”sang”,-13917
d.add ”sao”,-13914
d.add ”se”,-13910
d.add ”sen”,-13907
d.add ”seng”,-13906
d.add ”sha”,-13905
d.add ”shai”,-13896
d.add ”shan”,-13894
d.add ”shang”,-13878
d.add ”shao”,-13870
d.add ”she”,-13859
d.add ”shen”,-13847
d.add ”sheng”,-13831
d.add ”shi”,-13658
d.add ”shou”,-13611
d.add ”shu”,-13601
d.add ”shua”,-13406
d.add ”shuai”,-13404
d.add ”shuan”,-13400
d.add ”shuang”,-13398
d.add ”shui”,-13395
d.add ”shun”,-13391
d.add ”shuo”,-13387
d.add ”si”,-13383
d.add ”song”,-13367
d.add ”sou”,-13359
d.add ”su”,-13356
d.add ”suan”,-13343
d.add ”sui”,-13340
d.add ”sun”,-13329
d.add ”suo”,-13326
d.add ”ta”,-13318
d.add ”tai”,-13147
d.add ”tan”,-13138
d.add ”tang”,-13120
d.add ”tao”,-13107
d.add ”te”,-13096
d.add ”teng”,-13095
d.add ”ti”,-13091
d.add ”tian”,-13076
d.add ”tiao”,-13068
d.add ”tie”,-13063
d.add ”ting”,-13060
d.add ”tong”,-12888
d.add ”tou”,-12875
d.add ”tu”,-12871
d.add ”tuan”,-12860
d.add ”tui”,-12858
d.add ”tun”,-12852
d.add ”tuo”,-12849
d.add ”wa”,-12838
d.add ”wai”,-12831
d.add ”wan”,-12829
d.add ”wang”,-12812
d.add ”wei”,-12802
d.add ”wen”,-12607
d.add ”weng”,-12597
d.add ”wo”,-12594
d.add ”wu”,-12585
d.add ”xi”,-12556
d.add ”xia”,-12359
d.add ”xian”,-12346
d.add ”xiang”,-12320
d.add ”xiao”,-12300
d.add ”xie”,-12120
d.add ”xin”,-12099
d.add ”xing”,-12089
d.add ”xiong”,-12074
d.add ”xiu”,-12067
d.add ”xu”,-12058
d.add ”xuan”,-12039
d.add ”xue”,-11867
d.add ”xun”,-11861
d.add ”ya”,-11847
d.add ”yan”,-11831
d.add ”yang”,-11798
d.add ”yao”,-11781
d.add ”ye”,-11604
d.add ”yi”,-11589
d.add ”yin”,-11536
d.add ”ying”,-11358
d.add ”yo”,-11340
d.add ”yong”,-11339
d.add ”you”,-11324
d.add ”yu”,-11303
d.add ”yuan”,-11097
d.add ”yue”,-11077
d.add ”yun”,-11067
d.add ”za”,-11055
d.add ”zai”,-11052
d.add ”zan”,-11045
d.add ”zang”,-11041
d.add ”zao”,-11038
d.add ”ze”,-11024
d.add ”zei”,-11020
d.add ”zen”,-11019
d.add ”zeng”,-11018
d.add ”zha”,-11014
d.add ”zhai”,-10838
d.add ”zhan”,-10832
d.add ”zhang”,-10815
d.add ”zhao”,-10800
d.add ”zhe”,-10790
d.add ”zhen”,-10780
d.add ”zheng”,-10764
d.add ”zhi”,-10587
d.add ”zhong”,-10544
d.add ”zhou”,-10533
d.add ”zhu”,-10519
d.add ”zhua”,-10331
d.add ”zhuai”,-10329
d.add ”zhuan”,-10328
d.add ”zhuang”,-10322
d.add ”zhui”,-10315
d.add ”zhun”,-10309
d.add ”zhuo”,-10307
d.add ”zi”,-10296
d.add ”zong”,-10281
d.add ”zou”,-10274
d.add ”zu”,-10270
d.add ”zuan”,-10262
d.add ”zui”,-10260
d.add ”zun”,-10256
d.add ”zuo”,-10254

function g(num)
if num>0 and num<160 then
g=chr(num)
else
if num<-20319 or num>-10247 then
g=”"
else
a=d.Items
b=d.keys
for i=d.count-1 to 0 step -1
if a(i)<=num then exit for
next
g=b(i)
end if
end if
end function
function c(str)
c=”"
for i=1 to len(str)
c=c&g(asc(mid(str,i,1)))
next
end function
response.write c(request(“hz”))
%>
<form method=post>
请在此处输入中文:<input name=hz>
</form>

Powered by WordPress