what is a better way to write this, i want it to be able to read the file, then replace the text in the file.

VB Code:
  1. Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
  2.         IO.File.Delete("dtmbuffer.txt")
  3.         IO.File.Copy("dtm.txt", "dtmbuffer.txt")
  4.         Dim dtm As IO.StreamReader = IO.File.OpenText("dtmbuffer.txt")
  5.         Dim dtm2 As IO.StreamWriter = IO.File.AppendText("dtm.txt")
  6.         Try
  7.             Select Case dtm.ReadLine()
  8.                 Case Is = 1
  9.                     MsgBox("Task Manager is already disabled.")
  10.                     Me.Close()
  11.                 Case Is = 0
  12.                     Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
  13.                     Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True).SetValue("disabletaskmgr", "1")
  14.                     dtm2.WriteLine("1")
  15.                     MsgBox("Task Manager is now disabled.")
  16.                     Me.Close()
  17.             End Select
  18.  
  19.         Catch ex As Exception
  20.  
  21.         End Try
  22.     End Sub