protected void btnGet_Click(object sender, EventArgs e) { if (FUBrowse.HasFile) { string path = FUBrowse.PostedFile.FileName; this.FUBrowse.SaveAs(path); this.txtJobDescription.Text = ShowContent(path); } } public string ShowContent(string path) { string strInput = ""; string GetStream = ""; if (File.Exists(path)) { StreamReader sr = new StreamReader(path, UnicodeEncoding.GetEncoding("UTF-8")); strInput = sr.ReadLine(); while (strInput != null) { GetStream += strInput; strInput = sr.ReadLine(); } sr.Close(); } else { Response.Write("file does not exist!"); } return GetStream; }
string path = FUBrowse.PostedFile.FileName; string serverPath = HttpContext.Current.Server.MapPath("~/"); path = serverPath + path; this.FUBrowse.SaveAs(path); this.txtJobDescription.Text = ShowContent(path);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)