File Reader sample

private void GetFileContents(String FileName)
    {
        try
        {
            FileInfo inf = new FileInfo(FileName);
            StreamReader rd = new StreamReader(inf.OpenRead());
            tb_Context.Text = rd.ReadToEnd();
            rd.Close();
                }
        catch (Exception e)
        {
            Response.Write("<script>alert('"+e.Message+"')</script>");
        }
}

 

posted on 2008-01-04 21:41  飞天舞者  阅读(164)  评论(0编辑  收藏  举报

导航

For more information about me, feel free email to me winston.he@hotmail.com