Pages

Wednesday, May 22, 2013

How to Read From a Text File c#



public partial class how_to_readfile : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string[] copy = File.ReadAllLines("F:\\pravat.txt");  // create text file in ur computer(write something)
        for (int i = 0; i < copy.Length; i++)
        {
            Response.Write(copy[i]+"<br/>");
        }
    }
}

No comments:

Post a Comment