Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/05/2003, 17:32
Avatar de maestro
maestro
 
Fecha de Ingreso: febrero-2002
Ubicación: España
Mensajes: 2.364
Antigüedad: 23 años, 3 meses
Puntos: 1
Varias opciones:

<%
'Crear Ficheros verificando antes su existencia
set FSO = Server.CreateObject("Scripting.FileSystemObject")
If fso.FileExists (Server.MapPath("prueba.txt")) Then
response.write("ya existe")
else
set oFich = FSO.CreateTextFile ( Server.MapPath("prueba.txt"), True )
response.write("Se ha creado & ofich")
end if
%>

<%
'Borrar ficheros
set FSO = Server.CreateObject("Scripting.FileSystemObject")
set oFich = FSO.deletefile (Server.MapPath("prueba.txt"))
%>

<%
'Añadir lineas a un fichero
set FSO = Server.CreateObject("Scripting.FileSystemObject")
set oFich = FSO.OpenTextFile(Server.MapPath("prueba.txt"), 8)
'8=ForAppending Abre un archivo y escribe al final del mismo.
oFich.WriteLine ("Esta es la nueva línea que hemos añadido.")
oFich.Close
set oFich = nothing
%>

Para mas informacion sigue este link:
http://www.aspfacil.com/articulos/verarticulo.asp?id=56
http://asp.com-e.net/codigo/fso.asp
__________________
Jose Maria Fernandez
[email protected]
Http://www.expansionweb.net