i have make same changes then its working thanks.
namespace ReadTxtFile
{
public partial class WebForm7 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[]
{
new DataColumn("Parameters"),
new DataColumn("CO2"),
new DataColumn("NO"),
new DataColumn("SO2"),
new DataColumn("CO"),
new DataColumn("PM"),
new DataColumn("Flow")
});
dt.Rows.Add("UoM", "%", "ppm", "ppm", "ppm", "mg/Nm", "m/s");
string stack1 = (new WebClient()).DownloadString("file://10.1.150.237/display%20board/STACK1UNIT1.txt");
// string stack1 = File.ReadAllText(Server.MapPath("/10.1.150.237/display%20board/STACK2UNIT2.txt"));
string stack2 = (new WebClient()).DownloadString("file://10.1.150.237/display%20board/STACK2UNIT2.txt");
string[] splitParams = new[] { "CO2", "NO", "SO2", "CO", "PM", "FLOW" };
string[] values = stack1.Split(splitParams, StringSplitOptions.RemoveEmptyEntries);
dt.Rows.Add("UNIT#1", values[0], values[1], values[2], values[3], values[4], values[5]);
values = stack2.Split(splitParams, StringSplitOptions.RemoveEmptyEntries);
dt.Rows.Add("UNIT#2", values[0], values[1], values[2], values[3], values[4], values[5]);
gridView1.DataSource = dt;
gridView1.DataBind();
}
}
}