I want to read specific data from bat file (set values) and then write them into Textbox1.Text (these are first lines of file I want to read from) and I want to get values

XXXXX write to Textbox1.Text

YYYYY write to Textbox2.Text

ZZZZZ write to Textbox3.Text

SSSSS write to Textbox4.Text

```
   @echo off

   :::::: DANE LOGOWANIA DO BAZY DANYCH
   :: Baza danych
   set DB=XXXXX
   :: Serwer Bazy danych
   set DBServer=YYYYY
   :: Login do bazy danych
   set DBUser=ZZZZZ
   :: Hasło do bazy danych
   set DBPassword=SSSSS

```

Reading from file should be triggered from

```
   private void mssqlbutton_Click(object sender, EventArgs e)
   {

   }

```

Then if someone change `Textbox1.Text` value it writes those values into file in the position it previously read from.

I've tried finding for a solution using regex, reading by lines but it doesn't work for me or I don't know at all how to do it. 

To be precise, I'm just starting my adventure with C#, I'm not that familiar with it yet, so If you could explain to me as well instead of only providing a code I would be grateful :)

EDIT:
Actually it is not that small, whole bat file is like that:
<http://wklej.to/sCQ6i>
(I know bat file delete log file at the end but i will handle it)

And AppCode:
<http://wklej.to/Z5IFd>

Where in AppCode
`DBServerInput.Text was Textbox1.Text
DBInput.Text was Textbox2.Text
DBUserInput.Text was Textbox3.Text
DBPasswordInput was Textbox4.Texte`