Ir para conteúdo
Fórum Script Brasil

cyberalexxx

Membros
  • Total de itens

    2.500
  • Registro em

  • Última visita

Tudo que cyberalexxx postou

  1. Cara, eu nunca uso os parenteses e sempre funciona: if nNivel = "2" and nNivel = "1" and nCad = "cad" then
  2. Enquanto estiver testando no IIS, você pode colocar o endereço fisico completo. Quando passar para o server ai é melhor usar Server.Mappath
  3. cyberalexxx

    Contador De Cliks

    Voce não abriu a conexão!! abra a conexão antes da linha 66 rsu.open sql,conexao,3,3
  4. E ai beleza!! Seja BemVindo mudei um pouco o código v c você entende qqer duvida é só postar set dados = objconn.execute(instrucao_sql) while not dados.eof response.write " " & dados.fields("descricao") & "<br>" response.write "Genero: " & dados.fields("genero") & " - " & dados.fields("categ") & "<br>" dados.MoveNext wend
  5. cyberalexxx

    Me Ajudem !

    Eu tambem me amo, he he funcionou??? A paginação ta funcionando? acho que esta com problemas.
  6. cyberalexxx

    Me Ajudem !

    config.inc <% nmax = 5 cfoto = "/testes/fotos" fpagina = 5 finizio = 1 pnum = 1 %> thumb.asp <html> <head> <title>Thumbnail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .mytxt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal} --> </style> <script language="JavaScript"> <!-- function openCentered(theURL,winName,winWidth,winHeight,features) { var w = (screen.width - winWidth)/2; var h = (screen.height - winHeight)/2 - 60; features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w; window.open(theURL,winName,features); } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> </head> <body bgcolor="#FFFFFF" leftmargin="3" topmargin="0" marginwidth="0" marginheight="0"> <!--#include file="config.inc" --> <% function GetBytes(flnm, offset, bytes) Dim objFSO Dim objFTemp Dim objTextStream Dim lngSize on error resume next Set objFSO = CreateObject("Scripting.FileSystemObject") ' First, we get the filesize Set objFTemp = objFSO.GetFile(flnm) lngSize = objFTemp.Size set objFTemp = nothing fsoForReading = 1 Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading) if offset > 0 then strBuff = objTextStream.Read(offset - 1) end if if bytes = -1 then ' Get All! GetBytes = objTextStream.Read(lngSize) 'ReadAll else GetBytes = objTextStream.Read(bytes) end if objTextStream.Close set objTextStream = nothing set objFSO = nothing end function function lngConvert(strTemp) lngConvert = clng(asc(left(strTemp, 1)) + ((asc(right(strTemp, 1)) * 256))) end function function lngConvert2(strTemp) lngConvert2 = clng(asc(right(strTemp, 1)) + ((asc(left(strTemp, 1)) * 256))) end function function gfxSpex(flnm, width, height, depth, strImageType) dim strPNG dim strGIF dim strBMP dim strType strType = "" strImageType = "(unknown)" gfxSpex = False strPNG = chr(137) & chr(80) & chr(78) strGIF = "GIF" strBMP = chr(66) & chr(77) strType = GetBytes(flnm, 0, 3) if strType = strGIF then ' is GIF strImageType = "GIF" Width = lngConvert(GetBytes(flnm, 7, 2)) Height = lngConvert(GetBytes(flnm, 9, 2)) Depth = 2 ^ ((asc(GetBytes(flnm, 11, 1)) and 7) + 1) gfxSpex = True elseif left(strType, 2) = strBMP then ' is BMP strImageType = "BMP" Width = lngConvert(GetBytes(flnm, 19, 2)) Height = lngConvert(GetBytes(flnm, 23, 2)) Depth = 2 ^ (asc(GetBytes(flnm, 29, 1))) gfxSpex = True elseif strType = strPNG then ' Is PNG strImageType = "PNG" Width = lngConvert2(GetBytes(flnm, 19, 2)) Height = lngConvert2(GetBytes(flnm, 23, 2)) Depth = getBytes(flnm, 25, 2) select case asc(right(Depth,1)) case 0 Depth = 2 ^ (asc(left(Depth, 1))) gfxSpex = True case 2 Depth = 2 ^ (asc(left(Depth, 1)) * 3) gfxSpex = True case 3 Depth = 2 ^ (asc(left(Depth, 1))) '8 gfxSpex = True case 4 Depth = 2 ^ (asc(left(Depth, 1)) * 2) gfxSpex = True case 6 Depth = 2 ^ (asc(left(Depth, 1)) * 4) gfxSpex = True case else Depth = -1 end select else strBuff = GetBytes(flnm, 0, -1) ' Get all bytes from file lngSize = len(strBuff) flgFound = 0 strTarget = chr(255) & chr(216) & chr(255) flgFound = instr(strBuff, strTarget) if flgFound = 0 then exit function end if strImageType = "JPG" lngPos = flgFound + 2 ExitLoop = false do while ExitLoop = False and lngPos < lngSize do while asc(mid(strBuff, lngPos, 1)) = 255 and lngPos < lngSize lngPos = lngPos + 1 loop if asc(mid(strBuff, lngPos, 1)) < 192 or asc(mid(strBuff, lngPos, 1)) > 195 then lngMarkerSize = lngConvert2(mid(strBuff, lngPos + 1, 2)) lngPos = lngPos + lngMarkerSize + 1 else ExitLoop = True end if loop ' if ExitLoop = False then Width = -1 Height = -1 Depth = -1 else Height = lngConvert2(mid(strBuff, lngPos + 4, 2)) Width = lngConvert2(mid(strBuff, lngPos + 6, 2)) Depth = 2 ^ (asc(mid(strBuff, lngPos + 8, 1)) * 8) gfxSpex = True end if end if end function '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: Inizio Thumb ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Set objFSO = CreateObject("Scripting.FileSystemObject") dove = server.MapPath("/testes/fotos") Set objF = objFSO.GetFolder(dove) Set objFC = objF.Files nfoto = 1 %> <table border="1" cellspacing="4" cellpadding="1" bgcolor="silver" class="mytxt"> <% ftot = 0 For Each f1 in objFC ftot = ftot + 1 Next starthere = (pnum-1) * fpagina endhere = pnum * fpagina + 1 'response.write ftot&"<br>" 'response.write starthere&"<br>" 'response.write endhere&"<br>" %> <%For Each f1 in objFC if gfxSpex(f1.Path, w, h, c, strType) = true and nfoto > starthere and nfoto < endhere then %> <%If n = 0 then%> <tr> <%End If%> <td> <div align="center"> <table border="0" width="110" cellpadding="0" cellspacing="0" height="80"> <tr> <td valign="middle" align="center" width="110" height="100"> <p align="center"><a href="javascript:openCentered('http://<%=request.servervariables("HTTP_HOST")%>/<%=cfoto%>/<%=f1.name%>','fotoprod','<%=w+20%>','<%=h+20%>','toolbar=no')"><img src="../<%=cfoto%>/<%=f1.name%>" width="100" height="80" border=1 alt="Foto: <%=f1.name%> Creata il : <%=f1.DateCreated%> Peso : <%=f1.Size%> bytes Dimensioni : <%=w%> X <%=h%> pixel Colori : <%=c%> Foto = <%=nfoto%>"></a> </td> </tr> <tr> <td valign="middle" align="center" width="110" height="10"><span class="mytxt"><%=f1.name%></span><br> </td> </tr> </table> </div> </td> <%' response.write w & " x " & h & " " & c & " colors" ufoto = nfoto else response.write "&nbsp;" end if n = n + 1 nfoto = nfoto + 1 '-------------------------- inizio if n = nmax then n = 0 %> </tr> <% end If '-------------------------- fine Next %> </table> <table width="80%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="33%"> <div align="left"> <%if pnum <> 1 then%> <a href="thumb.asp?pnum=<%=pnum-1%>" class="mytxt">&laquo; indietro</a> <%end if%> </div> </td> <td width="34%"> <div align="center" class="mytxt"> | <% np = 1 Do while ftot-(np-1)*fpagina > 0%> <a href="thumb.asp?pnum=<%=np%>" class="mytxt"><%=np%></a> | <% np = np + 1 loop%> </div> </td> <td width="33%"> <div align="right"> <%if ftot > ufoto then%> <a href="thumb.asp?pnum=<%=pnum+1%>" class="mytxt">avanti &raquo;</a> <%end if%> </div> </td> </tr> </table> <% set objFC = nothing set objF = nothing set objFSO = nothing %> </body> </html>
  7. cyberalexxx

    Contador De Cliks

    Quando clicar na noticia, certamente voce vai fazer um select para visualizar a noticia, certo?? pegar tambem o valor de clicks e somar mais + 1 depois fazer um update no campo clicks, usando o mesmo critério de seleção que você usou na hora de exibir a noticia.
  8. cyberalexxx

    Acessar Paradox Via Asp

    use o driver OBDC do Dbase(dbf) "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\path;"
  9. cyberalexxx

    Me Ajudem !

    Linha 199: dove = server.MapPath("/testes/fotos") onde esta teste coloque o Alias da pasta de sua aplicação, vamos supor que voce execute seu sistema assim http://localhost/thumb/index.asp então substitua testes por thumb entendeu???
  10. cyberalexxx

    Me Ajudem !

    Me fala uma coisa pra mim te ajudar qual a pasta principal(raiz) do seu sistema?? em que pasta estão as fotos??
  11. cyberalexxx

    For E For Each

    olha aqui um exemplo na pratica que faz a mesma coisa usando for/next e for each <% dim a(3) a(0) = 1 a(1) = 11 a(2) = 111 'mostrar valores usando for next for x = 0 to Ubound(a)-1 response.write a(x) & "<br>" next response.write "-----------------<br>" 'mostrar valor usando for each for each valor in a response.write valor & "<br>" next %>
  12. cyberalexxx

    Me Ajudem !

    é o seguinte: A linha 201 pega uma pasta, só que a pasta não esta sendo encontrada. voce precisa informar corretamento o nome da pasta na linha 199
  13. cyberalexxx

    Problemas Com Contador

    Clique com o botão direito do mouse na pasta escolha: propriedades Compartilhamento WEB Editar Propriedades Depois Configure as permissões de acesso
  14. cyberalexxx

    Servervariables

    Não sei se existe, que tal executar todas as ServerVariables pra ver se alguma retorna a informação que voce quer?? é só fazer assim: <%For each Item in Request.ServerVariables Response.write Item & " – " & Request.ServerVariables(item) & "<BR>" Next%>
  15. cyberalexxx

    Problemas Com Contador

    Ta dando erro no servidor ou no IIS??
  16. cyberalexxx

    Me Ajudem !

    de um response.write na variavel Dove pra ver se o caminho esta apontando para a pasta correta, vamos supor que eu tenha um diretório principal com a pasta cfoto, então o seu código teria que ficar assim: linha 199 dove = server.MapPath("\cfoto")
  17. cyberalexxx

    Problemas Com Contador

    testei seu código e deram uns erros diferentes do que voce mostrou então mudei ele um pouco e funcionou: <% meucont = Server.MapPath( "contador.txt" ) Set Sys = Server.CreateObject( "Scripting.FileSystemObject" ) Set Txt = Sys.OpenTextFile( meucont, 1 ) contador = txt.Readline Txt.Close Contador = cint(trim(Contador)) + 1 Set Txt = Sys.OpenTextFile( meucont, 2 ) Txt.Write( Contador ) Txt.Close Response.Write( Contador ) Set Sys = NOTHING %> Quanto ao erro que voce apresentou, deve ser falta de permissão de escrita na pasta.
  18. cyberalexxx

    Relatórios

    da uma olha se é isso:
  19. cyberalexxx

    For E For Each

    For/next For each
  20. Voce esta usando algum componente??
  21. beleza!! qualquer duvida na minha lógica pra adaptar ai é so falar.
  22. cyberalexxx

    Auto Numeração

    faz assim: Pegue o ultimo registro da tabela, supondo que o campo seja numero <% set RS=conexao.execute("select top 1 * from pedidos order by numero desc") do while not Rs.Eof nr = Rs.Fields("numero") ' pegando ultimo numero loop nr_int = split(nr,"/") ' separando a informação nr de /004 novo_nr = Cint(nr_int(0)) + 1 'funcão para formatar numero para usar ex: formata(1,3,"04") resultado=001/04 function formata(valor,tam,final) cZero = "" if Len(Trim(cStr(valor))) < tam then For n = 1 to tam - Len(Trim(cStr(valor))) cZero = cZero&"0" Next end if formata = cZero&Trim(cStr(valor))&"/"&final end function novo_nr = formata(novo_nr,3,"04") %> Pronto o valor do novo registro esta armazenado na variavel novo_nr
  23. cyberalexxx

    Dúvida C/ Função If

    <% If len exe("foto1").Value > 0 then%> <img src="<%= exe("foto1").Value %>" width="236" height="185" align="absmiddle"> <%else%> <img src="fotopadrao.jpg" width="236" height="185" align="absmiddle"> <%end if%>
  24. Para Upload sem componente, utilizando um servidor grátis é possivel desde que o servidor tenha suporte a FSO.
×
×
  • Criar Novo...