首页 > 编程 > ASP > 正文

[ASP]精华代码

2024-05-04 10:59:06
字体:
来源:转载
供稿:网友
复制代码 代码如下:

<%
  ' -- Loader.asp --
  ' -- version 1.5.2
  ' -- last updated 12/5/2002
  '
  ' Faisal Khan
  ' faisal@stardeveloper.com
  ' www.stardeveloper.com
  ' Class for handling binary uploads

  Class Loader
    Private dict

    Private Sub Class_Initialize
      Set dict = Server.CreateObject("Scripting.Dictionary")
    End Sub

    Private Sub Class_Terminate
      If IsObject(intDict) Then
        intDict.RemoveAll
        Set intDict = Nothing
      End If
      If IsObject(dict) Then
        dict.RemoveAll
        Set dict = Nothing
      End If
    End Sub

    Public Property Get Count
      Count = dict.Count
    End Property

    Public Sub Initialize
      If Request.TotalBytes > 0 Then
        Dim binData
          binData = Request.BinaryRead(Request.TotalBytes)
          getData binData
      End If
    End Sub

    Public Function getFileData(name)
      If dict.Exists(name) Then
        getFileData = dict(name).Item("Value")
        Else
        getFileData = ""
      End If
    End Function

    Public Function getValue(name)
      Dim gv
      If dict.Exists(name) Then
        gv = CStr(dict(name).Item("Value"))

        gv = Left(gv,Len(gv)-2)
        getValue = gv
      Else
        getValue = ""
      End If
    End Function
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表