Advertisement
Ikillnukes

Untitled

Aug 1st, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.10 KB | None | 0 0
  1.             Dim strStreamWriter As StreamWriter
  2.             Dim strStreamW As Stream = Nothing
  3.             strStreamWriter = Nothing
  4.             Dim strStreamWriter2 As StreamWriter
  5.             Dim strStreamW2 As Stream = Nothing
  6.             strStreamWriter = Nothing
  7.             Dim ContenidoArchivo As String = Nothing
  8.             Dim PathArchivo As String = ".\Variables.txt"
  9.             Dim PathArchivo2 As String = ".\INSERTS.txt"
  10.  
  11.             Dim PathCarpeta As String = Replace(TextBox1.Text, PathArchivo.Substring(PathArchivo.LastIndexOf("/") + 1), "")
  12.  
  13.             'If Not Directory.Exists(PathCarpeta) Then
  14.             '    Directory.CreateDirectory(PathCarpeta)
  15.             'End If
  16.  
  17.             Do While Match.Success And Match2.Success
  18.  
  19.                 Try
  20.  
  21.                     If File.Exists(PathArchivo) Then
  22.                         strStreamW = File.Open(PathArchivo, FileMode.Append)
  23.                     Else
  24.                         strStreamW = File.Create(PathArchivo)
  25.                     End If
  26.  
  27.                     strStreamWriter = New StreamWriter(strStreamW, System.Text.Encoding.Default)
  28.  
  29.                     strStreamWriter.Write(Match.Groups("prueba").ToString & Environment.NewLine)
  30.                     Match = Match.NextMatch()
  31.  
  32.                     strStreamWriter.Close()
  33.  
  34.                     If File.Exists(PathArchivo2) Then
  35.                         strStreamW2 = File.Open(PathArchivo2, FileMode.Append)
  36.                     Else
  37.                         strStreamW2 = File.Create(PathArchivo2)
  38.                     End If
  39.  
  40.                     strStreamWriter2 = New StreamWriter(strStreamW2, System.Text.Encoding.Default)
  41.  
  42.                     strStreamWriter2.Write(Match.Groups("prueba2").ToString & Environment.NewLine)
  43.                     Match = Match.NextMatch()
  44.  
  45.                     strStreamWriter2.Close()
  46.  
  47.                 Catch ex As Exception
  48.                     MsgBox("Error al Guardar la ingormacion en el archivo. " & ex.ToString, MsgBoxStyle.Critical, Application.ProductName)
  49.                     strStreamWriter.Close()
  50.                 End Try
  51.             Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement