Traverse all subfolders under the folder and Traverse all Key,value in a node of the configuration file and bind to the GridView
Helper App_helper = new Helper ();
DataSet ds = new DataSet ();
DataTable dt = new DataTable ();
protected void Page_Load (object sender, EventArgs e) {gvwbind (); #region binding GridView///<summary>///binding gridview///</summary> protected void Gvwbind () {INI. INIPath Iniinipath = new INI.
INIPath (); Ini. INIFile iniinifile = new INI.
INIFile (Iniinipath.getinipath ()); String foldernames = App_helper.getallfolder (Server.MapPath ("...). /.. /appdir "))//Get all subfolders under Appdir folder name string[] FolderName = new String[foldernames.split (', '). length-1];//declare the array to save the folder absolute path FolderName = Foldernames.split (', ');//To assign a value dt to the folder absolute path.
Columns.Add ("Lkname", typeof (String)); Dt.
Columns.Add ("Qdjsjm", typeof (String)); Dt.
Columns.Add ("Qdipdz", typeof (String)); for (int i = 0; i < foldername.length-1 i++) {DataRow row = dt.
NewRow (); Foldername[i] = Foldername[i]. Substring (Foldername[i]. LastIndexOf (' \ \ ') + 1)//Intercepting folder name row["Lkname" = foldername[i];//to Lkname value if (assignmentsIfile.inireadvalue ("Dzjclkzp", Foldername[i]). Equals (""))//The configuration file has the same folder name key {row["QDJSJM"] = Iniinifile.inireadvalue ("Dzjclkzp", Foldername[i)). Split (', ') [0];//assign value to QDJSJM field row["Qdipdz"] = Iniinifile.inireadvalue ("Dzjclkzp", Foldername[i)). Split (', ') [1];//to Qdipdz field assignment} dt.
Rows.Add (row);
Gvwgkwh.datasource = dt;//bound to array gvwgkwh.databind (); #endregion binding GridView