About 49,400 results
Open links in new tab
  1. c# - Easiest way to read from and write to files - Stack Overflow

    Sep 27, 2011 · There are a lot of different ways to read and write files (text files, not binary) in C#. I just need something that is easy and uses the least amount of code, because I am going to …

  2. c# - How to get File Created Date and Modified Date - Stack …

    Apr 23, 2014 · I have an .NET EXE file . I want to find the file created date and modified date in C# application. Can do it through reflection or with IO stream?

  3. logging - How to write log file in c#? - Stack Overflow

    Nov 25, 2013 · How would I write a log file in c#? Currently i have a timer with this statement which ticks every 20 secs: File.WriteAllText(filePath+"log.txt", log); For everything that i want …

  4. How to read an entire file to a string using C#? - Stack Overflow

    Jan 25, 2017 · What is the quickest way to read a text file into a string variable? I understand it can be done in several ways, such as read individual bytes and then convert those to string. I …

  5. How to find out if a file exists in C# / .NET? - Stack Overflow

    Sep 2, 2008 · I would like to test a string containing a path to a file for existence of that file (something like the -e test in Perl or the os.path.exists() in Python) in C#.

  6. .net - Creating an empty file in C# - Stack Overflow

    Nov 23, 2016 · What's the simplest/canonical way to create an empty file in C#/.NET? The simplest way I could find so far is: System.IO.File.WriteAllLines(filename, new string[0]);

  7. Check last modified date of file in C# - Stack Overflow

    Jul 29, 2010 · Candyfloss 3,918 6 33 32 1 possible duplicate of How to get Modified date from file in c# – nawfal Dec 25, 2013 at 7:35 1

  8. c# - Open existing file, append a single line - Stack Overflow

    May 14, 2010 · I want to open a text file, append a single line to it, then close it.

  9. What is App.config in C#.NET? How to use it? - Stack Overflow

    Oct 24, 2012 · At its simplest, the app.config is an XML file with many predefined configuration sections available and support for custom configuration sections. A "configuration section" is a …

  10. c# - File not found Exception.. But it's there - Stack Overflow

    Mar 4, 2015 · 17 Try doing Directory.GetFiles(@"C:\logs"). It's possible that the file in question has odd characters that are getting interpreted one way by Windows Explorer (presumably …