|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。----filename/upaoad.asp/
<%
PublicFunctionBuildUploadRequest(strRequestBin)
DimPosBeg,PosEnd,boundary,boundaryPos
Gettheboundary
PosBeg=1
PosEnd=InstrB(PosBeg,strRequestBin,getByteString(chr(13)))
boundary=MidB(strRequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos=InstrB(1,strRequestBin,boundary)
Getalldatainsidetheboundaries
Dountil(boundaryPos=InstrB(strRequestBin,boundary&getByteString("--")))
Membersvariableofobjectsareputinadictionaryobject
DimUploadControl
SetUploadControl=CreateObject("Scripting.Dictionary")
DimPos,Name
Getanobjectname
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))
DimPosFile,PosBound,ContentType,Value
Testifobjectisoffiletype
PosFile=InstrB(BoundaryPos,strRequestBin,getByteString("filename="))
PosBound=InstrB(PosEnd,strRequestBin,boundary)
IfPosFile0ANDPosFile<PosBoundThen
GetFilePathNameofthefile
PosBeg=PosFile+Len("filename=")+1
PosEnd=InstrB(PosBeg,strRequestBin,getByteString(chr(34)))
FilePathName=getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
Addfilename(withpath)todictionaryobject
UploadControl.Add"FilePathName",FilePathName
GetContent-Typeofthefile
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))
Addcontent-typetodictionaryobject
UploadControl.Add"ContentType",ContentType
Getcontentofobject
PosBeg=PosEnd+4
PosEnd=InstrB(PosBeg,strRequestBin,boundary)-2
Value=MidB(strRequestBin,PosBeg,PosEnd-PosBeg)
Else
Getcontentofobject
Pos=InstrB(Pos,strRequestBin,getByteString(chr(13)))
PosBeg=Pos+4
PosEnd=InstrB(PosBeg,strRequestBin,boundary)-2
Value=getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
EndIf
Addcontenttodictionaryobject
UploadControl.Add"Value",Value
Adddictionaryobjecttomaindictionary
SetUploadRequest(Name)=UploadControl
Looptonextobject
BoundaryPos=InstrB(BoundaryPos+LenB(boundary),strRequestBin,boundary)
Loop
EndFunction
Stringtobytestringconversion
PublicFunctiongetByteString(strString)
DimintCount
getByteString=""
ForintCount=1toLen(strString)
getByteString=getByteString&chrB(AscB(Mid(strString,intCount,1)))
Next
EndFunction
Bytestringtostringconversion
PublicFunctiongetString(strString)
DimintCount
getString=""
ForintCount=1toLenB(strString)
getString=getString&chr(AscB(MidB(strString,intCount,1)))
Next
EndFunction
%>
缺乏可以共同遵循的行业标准,ASP还处在发展初期,大家对它的理解不同,如产品和服务标准,收费标准等,不利于行业的健康发展。 |
|