0

C# method txt

My homework: Please write a method that finds the given keyword and value from the config.txt file and returns it. Config.txt: Firmenname = Firmen ABC UID= AT324852 Email = office@firmenabc.at Gf = Max Mustermann Can someboy help me? My windows won’t boot up but I need something for tomorrow! Thanks!

30th Sep 2021, 4:52 PM
Attila Krizsó
3 Respostas
+ 4
Attila Krizsó , is it just to read the the content line by line and print it, or is there a kind of selection. does the file have multiple companies / users ... it needs a bit more information. thanks!
30th Sep 2021, 5:04 PM
Lothar
Lothar - avatar
0
using System; using System.IO; public class Program { static public void Main () { string inhalt = ""; inhalt = File.ReadAllText(@"D:\meineDateien\Config.txt"); Console.WriteLine(inhalt); } }
30th Sep 2021, 4:52 PM
Attila Krizsó
0
It has just these 4 lines. No other data. If I’d like to know the UID the method have to return just the UID. If I’d like to have only the email adress, the method have to return only the email adress. Etc.
30th Sep 2021, 5:08 PM
Attila Krizsó