Ver Mensaje Individual
  #6 (permalink)  
Antiguo 17/12/2009, 11:03
Avatar de Myakire
Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 23 años, 3 meses
Puntos: 146
Respuesta: Problemas al escribir en fichero con WriteLine !! Me supera

mmmmmmmmmmmmmmmmm

ok

a ver, ¿y si lo hacemos caracter por caracter y remplazamos el que nos cause el error?

Código ASP:
Ver original
  1. path_file = "C:\Inetpub\wwwroot\Sitios\MisPruebas\"
  2. name_file = "prueba.htm"
  3. strURL_ES = "http://prf.icecat.biz/index.cgi?prod_id=301192EK;vendor=LACIE;lang=ES;shopname=OpenICEcat-url#"
  4. 'strURL_ES = "http://prf.icecat.biz/index.cgi?prod_id=3093B003AA;vendor=CANON;lang=ES;shopname=OpenICEcat-url#"
  5.            
  6. Set HttpObj_ES = CreateObject("WinHttp.WinHttpRequest.5.1")
  7. HttpObj_ES.SetTimeouts 50000, 60000, 10000, 100000
  8. HttpObj_ES.Open "GET", strURL_ES, false
  9. HttpObj_ES.Send()
  10.  
  11. Text_Ficha_ES = HttpObj_ES.ResponseText
  12. Set HttpObj_ES = Nothing
  13. '
  14. '-- Creamos el fichero
  15. '
  16. Set fs_ES = CreateObject("Scripting.FileSystemObject")  ' Creamos el Fichero
  17. Set file_ES = fs_ES.CreateTextFile(path_file & name_file,True)  ' Abrimos el Fichero
  18.  
  19. ON ERROR RESUME NEXT
  20. Salida = ""
  21. FOR i=1 to LEN(Text_Ficha_ES)
  22.    Caracter = MID(Text_Ficha_ES, i, 1)
  23.      if Caracter = vbCrLf Then
  24.       file_ES.Writeline(Caracter)
  25.      Else
  26.       file_ES.Write(Caracter)
  27.      End If
  28.    If Err.Number <> 0 then
  29.       file_ES.Write("")
  30.       Error.Clear
  31.    End If
  32.      Salida = Salida & Caracter
  33. NEXT
  34. 'Response.Write(Salida)
  35. file_ES.Close
  36. Set file_ES = Nothing
  37. Set fs_ES = Nothing

te sirve esa alternativa?