Values together write to text file

  • Thread starter Thread starter dubiousp
  • Start date Start date
D

dubiousp

Guest
I have a number of text boxes, combo boxes and labels that values change depending inpt and calculation. My next step is to print to a file and perhaps read from file. The overal intention is to end up printing to a receipt type printer. The below all works fine the issue is however


The names print in a list

John

Doe

I would like them to print next to each other


John Doe

So a formatting question,


string folder = @"C:\tmp\";

// Filename
string fileName = "BASIC DATA";
// Fullpath. You can direct hardcode it if you like.
string fullPath = folder + fileName;
// An array of strings
string[] incname = { tBFIRSTNAME.Text, tBSURNAME.Text } ;


File.WriteAllLines(fullPath, incname);
// Read a file
string readText = File.ReadAllText(fullPath);
Console.WriteLine(readText);

Continue reading...
 
Back
Top