
22/12/2006, 12:43
|
| | Fecha de Ingreso: diciembre-2004
Mensajes: 160
Antigüedad: 20 años, 1 mes Puntos: 0 | |
Re: como puedo incluir el contenido de un archivo TXT en uno ASPX? si, tengo el siguiente codigo:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim oStreamReader As StreamReader
'
oStreamReader = File.OpenText("www.miweb.com\doc\archivo_1.txt")
Label1.Text = oStreamReader.ReadToEnd()
oStreamReader.Close()
End Sub
y me funciona bien cuando lo prueba localmente, pero cuando los subo al sitio me error de seguridad:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
No se si con este codigo File.ReadAllText(rutadelarchivo.txt) me de el problema.
Existirá otra forma de leer archivo texto? |