How about File.ReadAllText
:
string contents = File.ReadAllText(@"C:\temp\test.txt");
More Related Contents:
- Easiest way to read from and write to files
- How do I read a specified line in a text file?
- How to parse a string into a nullable int
- Extremely Large Single-Line File Parse
- c# search string in txt file
- Using StreamReader to check if a file contains a string
- Iterating through a List and .Contains isn’t catching string [closed]
- .NET String.Format() to add commas in thousands place for a number
- Identify if a string is a number
- Will the IE9 WebBrowser Control Support all of IE9’s features, including SVG?
- Are string.Equals() and == operator really same? [duplicate]
- How can I convert an integer into its verbal representation?
- How can I strip HTML tags from a string in ASP.NET?
- Convert a list to a string in C#
- Serialize an object to string
- What does $ mean before a string?
- How to change the color of progressbar in C# .NET 3.5?
- Replace multiple characters in a C# string
- Json Convert empty string instead of null
- Remove HTML tags from string including   in C#
- How to get the last five characters of a string using Substring() in C#?
- Count the number of times a string appears within a string [duplicate]
- How do I get the Local Network IP address of a computer programmatically?
- Pass C# string to C++ and pass C++ result (string, char*.. whatever) to C#
- Truncate string on whole words in .NET C#
- Formatting a C# string with identical spacing in between values
- How can I Unescape and Reescape strings in .net?
- What does the @ prefix do on string literals in C#
- How can I safely convert a byte array into a string and back? [duplicate]
- Dealing with invalid XML hexadecimal characters