<% Dim i,num1,num2,num3,op1,op2,op3,op4,mcap,res Randomize num1=round(rnd*9) num2=round(rnd*9) num3=round(rnd*9) op1=round(rnd*2) op2=round(rnd*2) if(op1="0")then op3="+" end if if(op1="1")then op3="-" end if if(op1="2")then op3="*" end if if(op2="0")then op4="+" end if if(op2="1")then op4="-" end if if(op2="2")then op4="*" end if if(op3="*") then if(op4="*") then mcap="("&num1&op3&num2&")"&op4&num3 elseif(op4="+" or op4="-") then mcap="("&num1&op3&num2&")"&op4&num3 end if elseif(op3="+" or op3="-") then if(op4="+" or op4="-") then mcap="("&num1&op3&num2&")"&op4&num3 elseif(op4="*") then mcap=num1&op3&"("&num2&op4&num3&")" end if end if if(op3="+" and op4="+") then res=(num1+num2)+num3 elseif(op3="+" and op4="-") then res=(num1+num2)-num3 elseif(op3="+" and op4="*") then res=num1+(num2*num3) elseif(op3="-" and op4="+") then res=(num1-num2)+num3 elseif(op3="-" and op4="-") then res=(num1-num2)-num3 elseif(op3="-" and op4="*") then res=num1-(num2*num3) elseif(op3="*" and op4="+") then res=(num1*num2)+num3 elseif(op3="*" and op4="-") then res=(num1*num2)-num3 elseif(op3="*" and op4="*") then res=(num1*num2)*num3 end if Function GetTempFileName(Byref FS) GetTempFileName = FS.GetSpecialFolder(2) & "\" & rnd & ".gif" End Function Sub CreateGifFromText(inText, FileName) Dim chs: Set Chs = getOWC Dim Chart: Set Chart = chs.Charts.Add //Get Chart Object Chart.HasTitle = True //Enable Chart Title Chart.Title.Caption = inText //Set the text Chart.Title.Font.Color = "#660000" Chart.Title.Font.italic = true Chart.Title.font.bold = true chs.Interior.Color="#d3d3d3" //Chart background chs.ExportPicture FileName,, 70, 40 // Save the image as file End Sub Function getOWC Dim chs : Set Chs = CreateObject("OWC10.ChartSpace") //create an OWC chart object. OWC(Office Web Components) is an library if isempty(Chs) then Set Chs = CreateObject("OWC11.ChartSpace") Set getOWC = Chs End Function Function ReadBinaryFile(FileName) Const adTypeBinary = 1 Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open BinaryStream.LoadFromFile FileName ReadBinaryFile = BinaryStream.Read End Function Function textToGIF(inText) Dim FS: Set FS = CreateObject("Scripting.FileSystemObject") Dim FileName: FileName = GetTempFileName(FS) CreateGifFromText inText, FileName //sub procedure textToGIF = ReadBinaryFile(FileName) FS.DeleteFile FileName End Function Response.ContentType = "image/gif" session("checktext") = res Response.binarywrite textToGIF(mcap) %>