Тёмный

Read and Write files in 10 minutes | C# 

tutorialsEU
Подписаться 98 тыс.
Просмотров 38 тыс.
50% 1

In this video you will learn how yo read files in C#
🚀 Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
Welcome back to a new C# tutorial. In this tutorial, we will learn how to write and read files in C#.
It is okay when as a developer to feel uneasy when accessing data from outside the scope of our applications.
We will be using the StreamReader class and read the text from our file line by line.
After that, we will discuss different methods to read and write files in C# using the ReadAllText method which will read all the text at once as a string.
When writing and reading files it's important to to handle the possible exceptions that might get thrown, and to also close any stream reader or writer inside the finally block.
tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@tutorialsEU
@tutorialsEU Год назад
🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
@mr-spoon
@mr-spoon 2 месяца назад
THANKS ! very helpfull video
@64imma
@64imma 9 месяцев назад
Is there a way to append text to a file, rather than totally erasing the contents of it every time you write to it? Edit: yes there is. If you pass true into the parameters for your new streamwriter object, it will enable appending mode, rather than rewriting the entire file.
@baidennewlove3070
@baidennewlove3070 3 года назад
Surely, I am already in class. Thanks for the video. Helped me have a feel of what's ahead. Interesting stuff.:)
@tutorialsEU
@tutorialsEU 3 года назад
Thanx for watching : ).
@GiorgiBekurashvili
@GiorgiBekurashvili 9 месяцев назад
Doggo increasses performance ! ❤
@storypur
@storypur 2 года назад
Is Lenovo legion 5 pro good for android and web development purposes? Processor and memory features - • 11th generation, core i7 • 16GB RAM, 1TB SSD • 6GB graphic/ NVIDIA GeForce RTX 3060 Or I should go for MacBook Air or Pro m1 With 16GB unified memory and 1TB SSD...?
@jj4l
@jj4l Год назад
Mac, the M-series chips are a developer dream. The build speed for NPM and Kotlin is insane.
@deodekri
@deodekri Год назад
How about MacBook pro M2 ?
@govindsankarmr2716
@govindsankarmr2716 Год назад
Just excellent, too good
@shazebs_
@shazebs_ Год назад
thank you for this simple tutorial
@sabernationtv
@sabernationtv 9 месяцев назад
How do we add the txt file as a project resource, instead of having it in a different folder?
@64imma
@64imma 9 месяцев назад
Couldn't you just use the using keyword to create your StreamWriter or StreamReader objects? That way, they will automatically close when the using block is finished.
@aryanshah3354
@aryanshah3354 3 года назад
Great video. which text editor is this?
@leehyun8174
@leehyun8174 3 года назад
Visual studio by windows
@aryanshah3354
@aryanshah3354 3 года назад
@@leehyun8174 ok thanks i use visual studio community but asked bc the autocomplete his had was much better than the one visual studio provides
@tutorialsEU
@tutorialsEU 3 года назад
It's Visual Studio 2022 Preview ;).
@aryanshah3354
@aryanshah3354 3 года назад
@@tutorialsEU ok thank you. Love all your videos btw. :)
@SudhanshuKumar-xy6xv
@SudhanshuKumar-xy6xv 2 года назад
Not related to this video which method is better? a. Inject viewModel in the activity holding the fragments and access that viewModel from fragment. b. Inject in each fragment separately
@storypur
@storypur 3 года назад
Sir please a section in your paid course that how can someone make a web admin for the app we are going to develop? As doing everything from Firebase is little bit complex for users you don't know about Firebase and it's really time taking so how can we make web admin panel for android app
@tutorialsEU
@tutorialsEU 3 года назад
Thank you for the suggestion, this could be an idea for a future tutorial : ).
@MsMalcolmX
@MsMalcolmX 3 года назад
How can I read a live * .log file and track changes?
@tutorialsEU
@tutorialsEU 3 года назад
The FileSystemWatcher class can be used to monitor changes made to a file system or directory and trigger events when such changes occur :).
@MsMalcolmX
@MsMalcolmX 3 года назад
@@tutorialsEU Thank you :D
@Ethan-xj7hb
@Ethan-xj7hb Год назад
0:30 why does he look like an elf?
@slsabeelsamir620
@slsabeelsamir620 2 года назад
انت عربي؟
Далее
C# Data Access: Text Files
24:34
Просмотров 267 тыс.
Я ж идеальный?😂
00:32
Просмотров 143 тыс.
Modus males sekolah
00:14
Просмотров 11 млн
How Do I Understand a Complex Codebase At Work?
10:39
how Google writes gorgeous C++
7:40
Просмотров 872 тыс.
.NET and C# are in trouble. Here is what I'd do.
10:57
C# Read and Write to a Text File
7:09
Просмотров 120 тыс.
Forget Controllers and Minimal APIs in .NET!
14:07
Просмотров 67 тыс.
Learn JSON in 10 Minutes
12:00
Просмотров 3,2 млн
Brutally honest advice for new .NET Web Developers
7:19
Я ж идеальный?😂
00:32
Просмотров 143 тыс.