Hola amigos estoy realizando un proyecto para generar licencias donde tengo un apartado del estado que guarda dicha licencia, al inicio de la app se genera un archivo de texto donde la cadena de texto tiene el dato de el estado de la licencia. el estado inicial es estado = Encriptar(?ACTIVO?), ahora este valor lo quiero sustituir por estado = Encriptar(VENCIDO), para ello estoy utilizando el siguiente código, pero me da error en la cuarta instrucción diciéndome que no existe el archivo pero realmente si existe. Alguien podrá apoyarme, dejo el código
Dim estado As String
estado = Encriptar("VENCIDO")
Using fileWrite As New StreamWriter(Application.StartupPath + "temp.txt")
Using fielRead As New StreamReader(Application.StartupPath + "licencia_temporal.txt")
Dim line As String = fielRead.ReadLine
Do While (Not line Is Nothing)
'Dim datos As String() = line.Split(New Char() {"|"c})
Dim partes As String() = line.Split("|"c) ' se establece el separador
If (partes(0) = "estado") Then 'ASI BUSCAMOS E IDENTIFICAMOS EL CEBO
partes(0) = "estado" 'DE ESTA FORMA SE ALTERA O MODIFICA EL VALOR DE CADA PARTE
'Apellido_lbl.Text = partes(0)
'fileWrite.WriteLine(String.Join("|", partes))
End If
' If Sw = False Then
fileWrite.WriteLine(String.Join("|", partes)) 'PARTES SOLA SON TODAS LAS PARTES O CASILLAS O SEPARACIONES DE _
'LA LISTA DEL ARCHIVO TXT
line = fielRead.ReadLine
'End If
Loop
End Using
End Using