• 网站首页
  • 涉税提问
  • 财税法规
  • 税收筹划
  • 优惠政策
  • 案例解析
  • 培训中心
  • 财富工具
  • 房产专题
  • 会计范文
中财税帮助

去向导航

  • 常见问题
  • 费用核算
  • 负债核算
  • 会计报表
  • 利润核算
  • 收入核算
  • 外汇核算
  • 资本核算
  • 资产核算
  • 更多...

常用分类

  • 浏览器
  • Windows
  • 音乐/电影
  • 网站开发
  • 游戏
  • 办公自动化

中财税帮助系统

2008-10-7

欢迎您登陆并使用中国财税咨询中心为您免费提供的资料,交流,学习为一体的平台!

如果您在使用中遇到什么问题,请您不要吝啬,一定要写信给我们!!

Email:Shellapi@126.com 期待您的来信,或指导批语!

帮助内难免有收集的资料,如果侵犯了您的仅力,请您来信告知,我们马上删除或更新处理!

文章搜索--请输入关键词:

不用组件实现上载功能(英文NT)

更多2008-10-7 日更新内容!
    '---- file name /upaoad.asp/



    <%

    Public Function BuildUploadRequest(strRequestBin)

    Dim PosBeg, PosEnd, boundary, boundaryPos

    'Get the boundary

    PosBeg = 1

    PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))

    boundary = MidB(strRequestBin,PosBeg,PosEnd-PosBeg)

    boundaryPos = InstrB(1,strRequestBin,boundary)



    'Get all data inside the boundaries

    Do until (boundaryPos = InstrB(strRequestBin,boundary & getByteString("--")))

    'Members variable of objects are put in a dictionary object

    Dim UploadControl

    Set UploadControl = CreateObject("Scripting.Dictionary")



    Dim Pos, Name

    'Get an object name

    Pos = InstrB(boundaryPos,strRequestBin,getByteString("Content-Disposition"))

    Pos = InstrB(Pos,strRequestBin,getByteString("name="))

    PosBeg = Pos + Len("name=") + 1

    PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))

    Name = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))



    Dim PosFile, PosBound, ContentType, Value

    'Test if object is of file type

    PosFile = InstrB(BoundaryPos,strRequestBin,getByteString("filename="))

    PosBound = InstrB(PosEnd,strRequestBin,boundary)



    If PosFile <> 0 AND PosFile < PosBound Then

    'Get FilePathName of the file

    PosBeg = PosFile + Len("filename=") + 1

    PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))

    FilePathName = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))



    'Add filename(with path) to dictionary object

    UploadControl.Add "FilePathName", FilePathName



    'Get Content-Type of the file

    Pos = InstrB(PosEnd,strRequestBin,getByteString("Content-Type:"))

    PosBeg = Pos + Len("Content-Type:") + 1

    PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))

    ContentType = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))



    'Add content-type to dictionary object

    UploadControl.Add "ContentType",ContentType



    'Get content of object

    PosBeg = PosEnd + 4

    PosEnd = InstrB(PosBeg,strRequestBin,boundary)-2

    Value = MidB(strRequestBin,PosBeg,PosEnd-PosBeg)

    Else

    'Get content of object

    Pos = InstrB(Pos,strRequestBin,getByteString(chr(13)))

    PosBeg = Pos + 4

    PosEnd = InstrB(PosBeg,strRequestBin,boundary)-2

    Value = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))

    End If



    'Add content to dictionary object

    UploadControl.Add "Value" , Value



    'Add dictionary object to main dictionary

    Set UploadRequest(Name) = UploadControl



    'Loop to next object

    BoundaryPos = InstrB(BoundaryPos+LenB(boundary),strRequestBin,boundary)

    Loop

    End Function



    'String to byte string conversion

    Public Function getByteString(strString)

    Dim intCount



    getByteString = ""



    For intCount = 1 to Len(strString)

    getByteString = getByteString & chrB(AscB(Mid(strString,intCount,1)))

    Next

    End Function



    'Byte string to string conversion

    Public Function getString(strString)

    Dim intCount



    getString = ""



    For intCount = 1 to LenB(strString)

    getString = getString & chr(AscB(MidB(strString,intCount,1)))

    Next

    End Function

    %>




Site designed by 中国财税咨询中心