Hey all,

I am writing a program that protects selected folders of your choice with a password. Going great so far, I was almost done, then I ran in to a problem.
The last thing that I need to complete is this:
I want the end user to be able to delete a directory. I am using a simple text file (that I change the extension to .dll for security purposes) to store the information of which directories to protect. The program reads from that file line by line to deterime which directories to protect.
There is a lot of code so I won't post it all, but I will post the section that I am working on.
Note, in the code that I have figured out how to match and find the line that I want to delete, I just don't know how to delete it.
VB Code:
  1. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  2.  
  3.         Dim fcontent() As String = Split(My.Computer.FileSystem.ReadAllText("C:\Program Files\Folder Protection\fld.dll"), vbCrLf) 'file from which to read text
  4.         For a As Integer = 0 To UBound(fcontent) 'reads the array of text lines
  5.             If String.Compare(fcontent(a), TextBox1.Text) = 0 Then  'compares the lines of text to the text in textbox1
  6.                       'CODE TO DELETE LINE HERE!!!
  7.             Else : MsgBox("Directory not found!")
  8.             End If
  9.         Next
  10.  
  11.     End Sub