Hello World

ASP.NET
C#

Read and display a text file
Inline Scripting
Uses StreamReader Object. Replaces \r and \n with <br>


Lorem Ipsum

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

CODE:

<script runat="server">
  public string ReadTextFile()
  {
	// The @ sign is for the path inclosed by quotes. verbatim string literal
	string FullPath = @"\\wdmycloudex2\webpage\TimJenkinsWeb\Testing\";
	
	// When using inline scipt you have to give the complete object path
	// Like System.IO.File.OpenTest instead of just File.OpenText
	System.IO.StreamReader sr = System.IO.File.OpenText(FullPath + "03a-SampleTextFile.txt");
	string strContents = sr.ReadToEnd();	
	
	// Replaces all return and new line with html line breaks
	strContents = strContents.Replace("\r\n","<br>");
	return strContents;
  }
</script>

<% =ReadTextFile() %>