Hola
Me gustaria poder abrir un .log cuando click en un boton. Como podria hacerlo para que me saque la ventana en la que te dice si quieres guardar o si quieres abrir el fichero?
Un saludo
| |||
| Respuesta: Abrir Notepad con un fichero .log Hola: Creo que te refieres a esto:
Código:
Espero que te sirvaDim rutaFichero AsString = Server.MapPath("PONER_AQUÍ_TU_FICHERO")
Dim infFichero As FileInfo = New FileInfo(rutaFichero)
If infFichero.Exists Then
Response.ClearContent()
Response.AddHeader("Content-Disposition", "attachment; filename=" + infFichero.Name)
Response.AddHeader("Content-Length", infFichero.Length.ToString())
Response.ContentType = ".log"
Response.TransmitFile(infFichero.FullName)
Response.End()
EndIf |
| ||||
| Respuesta: Abrir Notepad con un fichero .log Hola Kwasir Gracias por la respuesta, al final lo he hecho llamando a otra pagina en blanco y poniendole esto.
Código:
Con esto me abre el notepad con el texto que tenia el log. Response.ContentType = "text/plain"
Response.AppendHeader("content-disposition", "attachment; filename=" & ConfigurationManager.AppSettings("NombreLog") & ".log")
Dim str() As String = System.IO.File.ReadAllLines(ConfigurationManager.AppSettings("UrlLog"))
For Each linea In str
Response.Write(linea & vbCrLf)
Next
Un saludo
__________________ Bueno PEÑA AGUR !!! :adios: |