Wind sound without components

xiaoxiao2021-03-06  57

code:

<% '----------------------------------------------- ----------- '**************** The wind is not included in the component 2.0 ************************ ** 'author: wind' Web site:

http://www.17560.net

http://www.54nb.com

'Mail: rumor@17560.net' Copyright: All rights reserved, source code is open, all uses can be used for free use of '************************ ********************************* "--------------- ------------------------------------------- Class UploadClass Private P_maxsize, p_filetype, p_SavePath, p_AutoSave, p_Error Private objForm, binForm, binItem, strDate, lngTime Public FormItem, FileItem Public Property Get Version Version = "Rumor UpLoadClass Version 2.0" End Property Public Property Get Error Error = p_Error End Property Public Property Get MaxSize MaxSize = p_MaxSize End Property Public Property Let MaxSize (lngSize) if isNumeric (lngSize) then p_MaxSize = clng (lngSize) end if End Property Public Property Get FileType FileType = p_FileType End Property Public Property Let FileType (strType) p_FileType = strType End Property Public Property Get SavePath SavePath = p_SavePath End Property Public Property Let SavePath (strPath) p_SavePath = replace (strPath, chr (0), "") End Property Public Property Get AutoSave AutoSave = p_AutoSave End Property Public Property Let AutoSave (b yVal Flag) select case Flag case 0: case 1: case 2: case false: Flag = 2 case else: Flag = 0 end select p_AutoSave = Flag End Property Private Sub Class_Initialize p_Error = -1 p_MaxSize = 153600 p_FileType = "jpg / gif "P_savepath =" "p_autosave = 0 strdate = replace (Date ())," - "," ") LNGTIME = ClNG (Timer () * 1000) set binform = server.createObject (" adoDb.stream ") SET Binitem = Server.createObject ("AdoDb.Stream") set objform = server.createObject ("scripting.dictionary") Objform.comPareMode =

1 End Sub Private Sub Class_Terminate objForm.RemoveAll Set objForm = nothing Set binItem = nothing binForm.Close () Set binForm = nothing End Sub Public Sub Open () if p_Error = -1 then p_Error = 0 else Exit Sub end if Dim lngRequestSize, binRequestData, strFormItem, strFileItem Const strSplit = " '" ">" lngRequestSize = Request.TotalBytes if lngRequestSize <1 then p_Error = 4 Exit Sub end if binRequestData = Request.BinaryRead (lngRequestSize) binForm.Type = 1 binForm.Open binForm.Write binRequestData Dim bCrLf, strSeparator, intSeparator bCrLf = ChrB (13) & ChrB (10) intSeparator = InstrB (1, binRequestData, bCrLf) -1 strSeparator = LeftB (binRequestData, intSeparator) Dim p_start, p_end, strItem, strInam, intTemp, strTemp Dim strFtyp, strFnam, strFext, lngFsiz p_start = intSeparator 2 Do p_end = InStrB (p_start, binRequestData, bCrLf & bCrLf) 3 binItem.Type = 1 binItem.Open binForm.Position = p_start binForm.CopyTo binItem, p_end-p_start binItem.Position = 0 binitem.type = 2 binitem.charset = "GB2 312 "strItem = binItem.ReadText binItem.Close () p_start = p_end p_end = InStrB (p_start, binRequestData, strSeparator) -1 binItem.Type = 1 binItem.Open binForm.Position = p_start lngFsiz = p_end-p_start-2 binForm.CopyTo Binitem, LNGFSIZ INTTEMP = INSTR (39, Stritem, "" ") Strinam = MID (StriteM, 39, INTTEMP-39) IF INSTR (INTTEMP, STRITEM," FileName = "") <> 0 Then if not objform. Exists (Strinam & "_ from") THEN STRFILEITEM = STRFILETEM & STRSPLIT & STRINAM IF BINITEM.SIZE <> 0 THEN INTTEMP = INTTEMP

13 strfTyp = MID (Stritem, INSTR (INTTEMP, STRITEM, "Content-Type:") 14) strTemp = MID (Intetemp, INTTEMP, INSTR (INTTEMP, STRITEM, "" ") - INTTEMP) INTTEMP = INSTRREV (Strtemp , "/") strFnam = Mid (strTemp, intTemp 1) objForm.Add strInam & "_ Type", strFtyp objForm.Add strInam & "_ Name", strFnam objForm.Add strInam & "_ Path", Left (strTemp, intTemp) objForm.Add Strinam & "_ size", LNGFSIZ IF INSTR (INTTEMP, STRTEMP, ".") <> 0 THEN STRFEXT = MID (Strtemp, INSTRREV (STRTEMP, ") 1) Else Strfext =" "End ififfyp, 6) = "Image /" Then Binitem.position = 0 binitem.type = 1 strtemp = binitem.read (10) if strcomp (Strtemp, Chrb (255) & chrb (216) & chrb (255) & chrb (224) & Chrb (0) & chrb (16) & chrb (74) & chrb (70) & chrb (73) & chrb (70), 0) = 0 THEN IF LCASE (STRFEXT) <> "JPG" Then Strfext = " JPG "binitem.position = 3 do while not binitem.eos do intTemp = ASCB (Binitem.Read (1)) loop while intTemp = 255 and not binitem.eos if IntTemp <192 O R IntTemp> 195 Then Binitem.read (bin2val (binitem.read (2)) - 2) Else EXIT Do End if do IntTemp = ASCB (Binitem.Read (1)) Loop While IntTemp <255 and not binitem.eos loop Binitem .Read (3) objform.add strinam & "_ height", bin2val (Binitem.Read (2)) Objform.add Strinam & "_ Width", bin2val (Binitem.Read (2)) Elseif Strcomp (LEFTB (Strtemp, 8), ChRB (137) & chrb (80) & chrb (78) & chrb (71) &

CHRB (13) & chrb (10) & chrb (26) & chrb (10), 0) = 0 THEN IF LCASE (STRFEXT) <> "png" Then STRFEXT = "PNG" binitem.position = 18 objform.add Strinam & "_Width", bin2val (Binitem.Read (2)) Binitem.read (2) Objform.add Strinam & "Binitem.Read (2)) Elseif Strcomp (LEFTB (Strtemp, 6), Chrb (71) & Chrb (73) & chrb (70) & chrb (56) & chrb (57) & chrb (97), 0) = 0 or strcomp (Leftb (Strtemp, 6), Chrb (71) & chrb (73) & Chrb (70) & chrb (56) & chrb (55) & chrb (97), 0) = 0 Then if lcase (StrgrFext) <> "gif" dam = "gif" binitem.position = 6 objform.add Strinam & "_Width", binval2 (Binitem.Read (2)) Objform.Add Strinam & "Binitem.Read (2)) Elseif Strcomp (Leftb (Strtemp, 2), Chrb (66) & ChRB (77), 0) = 0 THEN IF LCASE (STRFEXT) <> "BMP" Then strfext = "bmp" binitem.position = 18 objform.add Strinam & "Binitem.Read (4)) Objform.add Strinam &" _ Height " , Binval2 (Binitem.Read (4)) end if end if objform.add strinam & "_ ext", StrFext objForm.Add strInam & "_ From", p_start intTemp = GetFerr (lngFsiz, strFext) if p_AutoSave <> 2 then objForm.Add strInam & "_ Err", intTemp if intTemp = 0 then if p_AutoSave = 0 then strFnam = GetTimeStr () if strFext < > "" "" "& Strfnam = strfnam &" "& strgrfext end if binitem.savetofile server.mappath (p_savepath)

strFnam), 2 objForm.Add strInam, strFnam end if end if else objForm.Add strInam & "_ Err", - 1 end if end if else binItem.Position 0 binItem.Type = 2 binItem.Charset = "gb2312" strTemp = binItem = .ReadText if objForm.Exists (strInam) then objForm (strInam) = objForm (strInam) & "," & strTemp else strFormItem = strFormItem & strSplit & strInam objForm.Add strInam, strTemp end if end if binItem.Close () p_start = p_end intSeparator 2 loop Until p_start 3> lngRequestSize FormItem = split (strFormItem, strSplit) FileItem = split (strFileItem, strSplit) End Sub Private Function GetTimeStr () lngTime = lngTime 1 GetTimeStr = strDate & lngTime End Function Private Function GetFerr (lngFsiz, strFext) dim intFerr INTFERR = 0 if lngfsiz> p_maxsize and p_maxsize> 0 Then if p_error = 0 or p_ERROR = 2 THEN P_ERROR = P_ERROR 1 INTFERR = INTFERR 1 End if IF INSTR (1, Lcase ("/" & p_filetype & "), LCase ("/" & strfext & "/")) = 0 and p_filetype <> "" "" THEN IF P_ERROR <2 THEN P_ERROR = P_ERROR 2 intFerr = intFerr 2 end if GetFerr = intFerr End Function Public Function Save (Item, strFnam) Save = false if objForm.Exists (Item & "_ From") then dim intFerr, strFext strFext = objForm (Item & "_ Ext") intFerr = GetFerr (Objform (item & "_ size"), strffext) IF Objform.exists (item & "_ err") THEN IFORM (Item & "_ Err") = 0 end if else objform.add item & "_ err", Intferr End IF IF Intferr <>

转载请注明原文地址:https://www.9cbs.com/read-83671.html

New Post(0)