To sign up for announcements about new videos and exclusive discounts, fill out this form: (your email will be kept safe and you will not be spammed).

Data access in C# is not really hard, but there is a lot of conflicting information out there. This video will help you clear up how to read from and write to a text file. It doesn’t cover every method, just one of the easiest.

0:00 – Intro
0:54 – Creating Demo Console App
1:39 – File path: string literal explained
2:51 – Reading from text file
5:00 – Writing to text file
7:07 – Populate DataModel fields form text file:
9:33 – • Line split
12:20 – • String interpolation
15:24 – Note on data validation when reading form text file
17:45 – Adding object to a list:
18:47 – • Anonymous instance explained
19:45 – List of DataModel to text file
23:22 – Summary and concluding remarks

Thanks Ralfs HBK for the chapter breakdown

Tag: c# read file, .net, C#, Visual Studio, code, programming, tutorial, c#

Xem thêm: https://côngnghệ

Nguồn: https://côngnghệ