<% GenerateImage(Eval("FetchImage()")) Function FetchImage() Dim fsoTmp Dim dirTmp Dim fileTmp Dim strTmp Dim strImg Dim arrTmp Dim rndNum Set fsoTmp = Server.CreateObject("Scripting.FileSystemObject") 'Set dirTmp = fsoTmp.GetFolder("D:\inetpub\Clientweb\CaptchaImages\") ' local Set dirTmp = fsoTmp.GetFolder("D:\Website\Clientweb\CaptchaImages\") ' server For Each fileTmp In dirTmp.Files strTmp = strTmp & "," & fileTmp.Name Next strImg = Mid(strTmp, 2) Set dirTmp = Nothing Set fsoTmp = Nothing arrTmp = Split(strImg, ",") Randomize() rndNum = Round(rnd() * 10) Select Case rndNum Case 0 Session("thisImg") = arrTmp(rndNum) Case 1 Session("thisImg") = arrTmp(rndNum) Case 2 Session("thisImg") = arrTmp(rndNum) Case 3 Session("thisImg") = arrTmp(rndNum) Case 4 Session("thisImg") = arrTmp(rndNum) Case 5 Session("thisImg") = arrTmp(rndNum) Case 6 Session("thisImg") = arrTmp(rndNum) Case 7 Session("thisImg") = arrTmp(rndNum) Case 8 Session("thisImg") = arrTmp(rndNum) Case 9 Session("thisImg") = arrTmp(rndNum) Case 10 Session("thisImg") = arrTmp(rndNum) End Select FetchImage = Session("thisImg") End Function Function GenerateImage(ByVal ImageName) Const adTypeBinary = 1 Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open() 'BinaryStream.LoadFromFile("D:\inetpub\Clientweb\CaptchaImages\" & ImageName) ' local BinaryStream.LoadFromFile("D:\Website\Clientweb\CaptchaImages\" & ImageName) ' server Response.ContentType = "image/gif" Response.BinaryWrite(BinaryStream.Read) BinaryStream.Close() Set BinaryStream = Nothing End Function %>