%@ LANGUAGE = "VBScript" %> <% Response.Expires = 0 response.redirect "http://www.uscampus.com.tw" %> <% dim SQLHeading, rsSch, schid, schct, schno, rd, schName randomize rd = rnd(12) SQLHeading = "SELECT [Schools].[SchoolID] AS SchoolID, [Name] from Schools where ([Level] = 2 OR [Level] = 3 OR [Level] = 4 OR [Level] = 5) and [Imageenable] = 1" if not isobject(session("connC")) then Set Session("connC")=Server.CreateObject("adodb.connection") Session("connC").open "ief","uscampus","webusers" end if Set rsSch = Session("connC").Execute(SQLHeading) schct = 0 while not rsSch.eof schct = schct + 1 rsSch.movenext wend schno = int(schct*rd) i = 0 rsSch.Movefirst while i < schno i = i+1 rsSch.Movenext wend schid = rsSch(0) schName = rsSch(1) %> <% DisplayMonth = (MonthName(Month(Date))) DisplayMonth = Left(DisplayMonth,3)&"." %> <% Dim intLowerBound ' Lower bound of the random number range Dim intUpperBound ' Upper bound of the random number range Dim intRangeSize ' Size of the range Dim sngRandomValue ' A random value from 0 to intRangeSize Dim intRandomInteger ' Our final result - random integer to return If IsNumeric(Request.QueryString("lowerbound")) Then intLowerBound = CLng(Request.QueryString("lowerbound")) Else intLowerBound = 0 End If If IsNumeric(Request.QueryString("upperbound")) Then intUpperBound = CLng(Request.QueryString("upperbound")) If intLowerBound = 0 And intUpperBound = 0 Then intUpperBound = 3 Else intUpperBound = 3 End If If intLowerBound > intUpperBound Then Dim iTemp iTemp = intLowerBound intLowerBound = intUpperBound intUpperBound = iTemp End If Randomize() intRangeSize = intUpperBound - intLowerBound + 1 sngRandomValue = intRangeSize * Rnd() sngRandomValue = sngRandomValue + intLowerBound intRandomInteger = Int(sngRandomValue) %>