title: VB.NET Multiple Replace In Text File
body: <p>I have 2 files , one index.html which is more like a template , and output index file which is a new file. the first index file contains ##1 , ##2 .... ##24 inside it , and i want those to be replaced with some links i provide within a text file. </p>
  
  <p>Let me explain my code. First i create my output file. 
  i declare the line array containing links which will replace the ##1 .... ##24.
  i loop 24 times to replace all ## with the Links provided from allLines. In the final file it only replaces some of the ## and not all </p>
  
  <p>My form looks like this <a href="https://s32.postimg.org/6h3ug8s7p/Untitled.png" rel="nofollow">https://s32.postimg.org/6h3ug8s7p/Untitled.png</a></p>
  
  <p>The problem is that it doesnt replace all links , it replaces only some of them and this is really weird. </p>
  
  <pre><code>    IO.File.Create(TextBox3.Text).Dispose()
  
      Dim allLines As String() = System.IO.File.ReadAllLines(TextBox1.Text)
      For c As Integer = 1 To 24 Step 1
  
          My.Computer.FileSystem.WriteAllText(TextBox3.Text, My.Computer.FileSystem.ReadAllText(TextBox2.Text).Replace("##" &amp; c, allLines(c - 1)), True)
  
      Next
  </code></pre>