CSharp - Zeile formatiert in Textdatei speichern
Ich möchte in C# eine Textzeile formatiert speichern.
Hallo Leute,
ich möchte in C# eine Textzeile formatiert in eine Textdatei speichern. Folgender Code verwende ich:
Das Ergebnis sieht so aus:
Nun möchte ich aber, dass das Ergebnis so aussieht:
Jedoch komme ich mit Tabstops nicht weiter. Gibt es eine möglichkeit das ganze richtig zu speichern?
Gruß
Neomatic
ich möchte in C# eine Textzeile formatiert in eine Textdatei speichern. Folgender Code verwende ich:
ManagementObjectSearcher svc = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_PerfFormattedData_PerfProc_Process");
foreach (ManagementObject queryObj in svc.Get())
{
int process_memory = Convert.ToInt32(queryObj["WorkingSetPrivate"]);
ticketWriter.WriteLine("{0}\t\t\t{1}\t\t\t{2}", queryObj["Name"], queryObj["PercentProcessorTime"] + " %", process_memory / 1024 + " kb");
}
Das Ergebnis sieht so aus:
taskhost#1 0 % 3904 kb
firefox 0 % 384020 kb
plugin-container 0 % 56856 kb
plugin-container#1 0 % 5184 kb
wuauclt 0 % 1624 kb
winamp 0 % 11244 kb
Nun möchte ich aber, dass das Ergebnis so aussieht:
taskhost#1 0 % 3904 kb
firefox 0 % 384020 kb
plugin-container 0 % 56856 kb
plugin-container#1 0 % 5184 kb
wuauclt 0 % 1624 kb
winamp 0 % 11244 kb
Jedoch komme ich mit Tabstops nicht weiter. Gibt es eine möglichkeit das ganze richtig zu speichern?
Gruß
Neomatic
Please also mark the comments that contributed to the solution of the article
Content-Key: 171304
Url: https://administrator.de/contentid/171304
Printed on: April 19, 2024 at 20:04 o'clock
2 Comments
Latest comment