0

I am creating an automation tool, to stop users messing with files, the thing is, my tool needs to work with an ini file which doesnt yet exist...

heres how i create the ini file...

String iniPath = @"C:\test.ini";
File.Create(iniPath);

that sets me up with my ini file... the thing is, its obviously blank and has no keys etc.

i need to populate it with the following information...

#redirect to production store
SDPORT=BGIT-SDIRLAUTO:4086
SDCLIENT=CTN610
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Slippy-D
0
private void button3_Click(object sender, EventArgs e)
    {
      const string fName = @"C:\file.txt";
      string txt = @"#redirect to production store" + Environment.NewLine +
                         @"SDPORT=BGIT-SDIRLAUTO:4086" + Environment.NewLine +
                         @"SDCLIENT=CTN610";
      if (System.IO.File.Exists(fName))
        System.IO.File.Delete(fName);
      System.IO.File.WriteAllText(@"C:\File.txt", txt);
    }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.