protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { dt.Columns.Clear(); dt.Columns.Add("FILENAME"); dt.Columns.Add("CDATE"); dt.Columns.Add("PATH"); DirectoryInfo parentDir; FileInfo[] childFiles; parentDir = new DirectoryInfo(Server.MapPath("~/XML/")); childFiles = parentDir.GetFiles(); foreach (FileInfo chDir in childFiles) { if (chDir.Extension != ".scc" && chDir.Name.Contains("MST")) { DataRow dr = dt.NewRow(); dr[0] = Convert.ToString(chDir.Name); dr[1] = Convert.ToString(chDir.CreationTime); dr[2] = Convert.ToString(chDir.FullName); dt.Rows.Add(dr); } } RG_Files.DataSource = dt; RG_Files.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { dt.Columns.Clear(); dt.Columns.Add("FILENAME"); dt.Columns.Add("CDATE"); dt.Columns.Add("PATH"); DirectoryInfo parentDir; FileInfo[] childFiles; parentDir = new DirectoryInfo(Server.MapPath("~/XML/")); childFiles = parentDir.GetFiles(); foreach (FileInfo chDir in childFiles) { if (chDir.Extension != ".scc" && chDir.Name.Contains("TRN")) { DataRow dr = dt.NewRow(); dr[0] = Convert.ToString(chDir.Name); dr[1] = Convert.ToString(chDir.CreationTime); dr[2] = Convert.ToString(chDir.FullName); dt.Rows.Add(dr); } } RG_Files.DataSource = dt; RG_Files.DataBind(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "XML", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }