How to manipulate file using WebPages (.cshtml)? In PHP we have fopen
and other functions, what are the counterparts?
In .NET you have the System.IO.File class. So for example if you wanted to read the contents of some text file in a variable:
@{
string contents = File.ReadAllText(@"c:\work\foo.txt");
}