Sitecore 5.1.1 API

MainUtil.ReadFromFile Method 

NOTE: This method is now obsolete.

Use FileUtil.ReadFromFile instead.


Reads a text file.

[Visual Basic]
Public Shared Function ReadFromFile( _
   ByVal path As String _
) As String
[C#]
public static string ReadFromFile(
   string path
);

Parameters

path
A file name.

Return Value

The content of the file.

Remarks

If the file is not found, an exception is written to the trace file and blank is returned.

Example

  string text = MainUtil.ReadFromFile("/robots.txt");

See Also

MainUtil Class | Sitecore Namespace