Example:
variable = new StreamReader( file ).ReadToEnd();
Is that acceptable?
You should always dispose of your resources.
// the using statement automatically disposes the streamreader because
// it implements the IDisposable interface
using( var reader = new StreamReader(file) )
{
variable = reader.ReadToEnd();
}
Or at least calling it manually:
reader = new StreamReader(file);
variable = reader.ReadToEnd();
reader.Close();