⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmledit.asp

📁 html编辑器
💻 ASP
📖 第 1 页 / 共 4 页
字号:
  If Trim(str)<>"" Then
     If isNumeric(str) Then str=Cstr(str)
     Dim newstr,i
     newstr=""
     For i=1 To Len(str)
         newstr=newstr & ascw(mid(str,i,1))
         If i<> Len(str) Then newstr= newstr & "a"
     Next
     CodeCookie=newstr
  Else
     CodeCookie=""
  End If
End Function
Public Function DecodeCookie(ByVal str)
  DecodeCookie=""
  If Trim(str)<>"" Then
     Dim newstr,i
     newstr=Split(str,"a")
     For i = LBound(newstr) To UBound(newstr)
         DecodeCookie= DecodeCookie & chrw(newstr(i))
     Next
  End If
End Function

Public Function MUPFilesGetv()
  ''--------  表单提交书写要求 --------''
  ''  enctype="multipart/form-data"    ''
  ''-----------------------------------''
  ''   TFormlname 提交的表单项目名称   ''
  ''------------  数组说明 ------------''
  '' 数组(0):表单项目名称             ''
  '' 数组(1):表单项目数据             ''
  '' 数组(2):表单(上传文件)类文件名称 ''
  '' 数组(3):表单(上传文件)类文件类型 ''
  '' 数组(4):表单(上传文件)类文件大小 ''
  ''-----------------------------------''
  DIM FMArray(50,4),ri,i
  DIM FM_type,FM_name,FM_value,FM_f_lx,FM_f_size,FM_f_name
  DIM FBytesDatacount,FBytesData
  DIM tStream,oUpFileStream,RequestBinDate,iFormEnd,bCrLf,sStart,iStart,iFormStart
  DIM iInfoStart,iInfoEnd,sInfo,iFindStart,iFindEnd,sFormName,sFileName,sFormValue
  FM_type    = ""
  FM_name    = ""
  FM_value   = ""
  FM_f_name  = ""
  FM_f_lx    = ""
  FM_f_size  = 0
  FBytesDatacount = Request.TotalBytes
  If FBytesDatacount < 1 Then Exit function
  FBytesData   = Request.BinaryRead(FBytesDatacount)
  set tStream  = Server.CreateObject("adodb.stream")
  set oUpFileStream = Server.CreateObject("adodb.stream")
  oUpFileStream.Type = 1
  oUpFileStream.Mode = 3
  oUpFileStream.Open
  oUpFileStream.Write FBytesData
  oUpFileStream.Position=0
  RequestBinDate = oUpFileStream.Read
  iFormEnd = oUpFileStream.Size
  bCrLf = chrB(13) & chrB(10)
  ''取得每个项目之间的分隔符''
  sStart = MidB(RequestBinDate,1, InStrB(1,RequestBinDate,bCrLf)-1)
  iStart = LenB (sStart)
  iFormStart = iStart+2
  ''分解项目''
  ri=0
  Do
     iInfoEnd = InStrB(iFormStart,RequestBinDate,bCrLf & bCrLf)+3
     tStream.Type = 1
     tStream.Mode = 3
     tStream.Open
     oUpFileStream.Position = iFormStart
     oUpFileStream.CopyTo tStream,iInfoEnd-iFormStart
     tStream.Position = 0
     tStream.Type = 2
     tStream.Charset ="gb2312"
     sInfo = tStream.ReadText
     '取得表单项目名称
     iFormStart = InStrB(iInfoEnd,RequestBinDate,sStart)-1
     iFindStart = InStr(22,sInfo,"name=""",1)+6
     iFindEnd   = InStr(iFindStart,sInfo,"""",1)
     sFormName  = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
     FM_type    = ""
     FM_name    = sFormName
     FM_value   = ""
     FM_f_name  = ""
     FM_f_lx    = ""
     FM_f_size  = 0
        If InStr (45,sInfo,"filename=""",1) > 0 Then
           '如果是文件
           FM_type="WJ"
           iFindStart = InStr(iFindEnd,sInfo,"filename=""",1)+10
           iFindEnd   = InStr(iFindStart,sInfo,"""",1)
           sFileName  = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
           FM_f_name  = Mid(sFileName,InStrRev(sFileName,"\")+1,Len(sFileName))
           iFindStart = InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
           iFindEnd   = InStr(iFindStart,sInfo,vbCr)
           FM_f_lx    = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
           FM_f_size  = iFormStart -iInfoEnd -2
           tStream.Close
           tStream.Type = 1
           tStream.Mode = 3
           tStream.Open
           oUpFileStream.Position = iInfoEnd 
           oUpFileStream.CopyTo tStream,iFormStart-iInfoEnd-2
           tStream.Position = 0
           FM_value = tStream.Read
           FMArray(ri,0)=FM_name
           FMArray(ri,1)=FM_value
           FMArray(ri,2)=FM_f_name
           FMArray(ri,3)=FM_f_lx
           FMArray(ri,4)=FM_f_size
        else
           '如果是表单项目
           tStream.Close
           FM_type="BD"
           tStream.Type = 1
           tStream.Mode = 3
           tStream.Open
           oUpFileStream.Position = iInfoEnd 
           oUpFileStream.CopyTo tStream,iFormStart-iInfoEnd-2
           tStream.Position = 0
           tStream.Type = 2
           tStream.Charset = "gb2312"
           sFormValue = tStream.ReadText
           FM_value   = sFormValue

           FMArray(ri,0)=FM_name
           FMArray(ri,1)=FM_value
           FMArray(ri,2)=FM_f_name
           FMArray(ri,3)=FM_f_lx
           FMArray(ri,4)=FM_f_size

        end If
     tStream.Close
     iFormStart = iFormStart+iStart+2
     ri=ri+1
  loop until (iFormStart+2) = iFormEnd
  Set tStream       = Nothing
  Set oUpFileStream = Nothing
  DIM temparray
  ReDim temparray(ri,4)
  For i=0 to 50
      If FMArray(i,0)<>"" Then
         temparray(i,0)=FMArray(i,0)
         temparray(i,1)=FMArray(i,1)
         temparray(i,2)=FMArray(i,2)
         temparray(i,3)=FMArray(i,3)
         temparray(i,4)=FMArray(i,4)
      Else
         Exit For
      End if
  Next
  MUPFilesGetv=temparray
End Function


Public Function MUPFilesTo(ByVal TFBinDate,ByVal Tpath,ByVal Tfname)
  ''-----------------------------------''
  '' TFBinDate  :表单项名称           ''
  '' Tpath      :服务器上的物理路径   ''
  '' Tfname     :目标文件名           ''
  ''-----------------------------------''
  MUPFilesTo=False
  DIM oStream,newpath
  If LenB(TFBinDate) > 0 Then
     set oStream = Server.CreateObject("adodb.stream")
     oStream.Type = 1
     oStream.Mode = 3
     oStream.Open
     oStream.Write TFBinDate
     newpath = Trim(Tpath)
     If Right(newpath,1) <> "\" Then newpath = newpath & "\"
     oStream.SaveToFile newpath & Tfname,2
     oStream.Close
     set oStream=nothing
     MUPFilesTo=True
  End If
End Function

Public Function MUPGtArrayone(ByVal TArray,ByVal Tws,ByVal Tvalue)
  Dim i
  MUPGtArrayone=0
  For i=0 to UBound(TArray)-1
      If TArray(i,Tws)=Tvalue Then
         MUPGtArrayone=i
         Exit For
      End If
  Next
End Function

Public Function GetMyTimeNumber(ByVal lx)
  randomize
  If lx=0 Then GetMyTimeNumber=Year(Date)*12*30*24*60*60*100+Month(Date)*30*24*60*60*100+Day(Date)*24*60*60*100+Hour(Time)*60*60*100+Minute(Time)*60*100+Second(Time)*100+Int(100 * Rnd)
  If lx=1 Then GetMyTimeNumber=Year(Date)*12*30*24*60*60+Month(Date)*30*24*60*60+Day(Date)*24*60*60+Hour(Time)*60*60+Minute(Time)*60+Second(Time)
  If lx=2 Then GetMyTimeNumber=Year(Date)*12*30*24*60+Month(Date)*30*24*60+Day(Date)*24*60+Hour(Time)*60+Minute(Time)
  If lx=3 Then GetMyTimeNumber=Year(Date)*12*30*24+Month(Date)*30*24+Day(Date)*24+Hour(Time)
  If lx=4 Then GetMyTimeNumber=Year(Date)*12*30+Month(Date)*30+Day(Date)
  If lx=5 Then GetMyTimeNumber=Year(Date)*12+Month(Date)
End Function



%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -