Estoy trabajando con ASP.NET 2.0. Tengo una pagina aspx que agrega datos en
un archivo de texto. Localmente funciona correctamente pero cuando la acceso
de otro equipo no funciona. A continuacion detallo el codigo :
Anexar_Datos_Archivo_Texto(CadenaTexto, "c:\AuditoriaFacturacionCredito.txt")
Public Function Anexar_Datos_Archivo_Texto(ByVal Texto_Anexar As String,
ByVal File_Name As String) As Boolean
' Create an instance of StreamWriter to write text to a file.
'Dim Sw As StreamWriter
Try
If Not File.Exists(File_Name) Then
Console.WriteLine("{0} El archivo No existe, Consulte con
informatica", File_Name)
Return False
End If
Using Sw As StreamWriter = File.AppendText(File_Name)
' Add some text to the file.
Sw.WriteLine(Texto_Anexar)
' Arbitrary objects can also be written to the file.
Sw.Close()
End Using
Catch ex As Exception
Console.WriteLine("Error")
MsgBox(ex.Message)
Return False
End Try
Return True
End Function
Leer las respuestas