C# Reading a File
This is how I read a file using C#.
Copy this code and paste it in your HTML
string DeathStarPlans = @"C:\DeathStarPlans.txt";
StringBuilder R2D2
= new StringBuilder
();
using ( StreamReader PrincessLeia
= new StreamReader
( DeathStarPlans
) ) {
while ( PrincessLeia.Peek() >= 0 )
{
R2D2.Append( PrincessLeia.ReadLine() );
}
}
Report this snippet
Comments
Subscribe to comments