Monday, July 13, 2015

C#, Read a file

C#, Code to read a file 

String strHtmlMessage = String.Empty;
String strFilePath = HttpContext.Current.Server.MapPath("~/Mails/Confirmationmaill.htm");
  using (StreamReader sr = new StreamReader(strFilePath))
  {
    strHtmlMessage = sr.ReadToEnd();
 }

No comments: