private string uploadFileList(string dir, int start, int limit)
{
DirectoryInfo Dir = new DirectoryInfo(dir);
if (Dir.Exists == true)
{
files = Dir.GetFiles();
DataTable dt = new DataTable();
DataColumn dc_id = new DataColumn();
dc_id.ColumnName = "id";
DataColumn dc_name = new DataColumn();
dc_name.ColumnName = "fileName";
dt.Columns.Add(dc_id);
dt.Columns.Add(dc_name);
for (int i = 0; i < files.Length; i++)
{
DataRow dr = dt.NewRow();
dr["id"] = i + 1;
dr["fileName"] = files[i].Name;
dt.Rows.Add(dr);
}
int j = start;
for ( ; j < start + limit; j++)
{
if (j >= files.Length)
{
break;
}
else
{
m_CBasePage.AddItem("id", dt.Rows[j]["id"].ToString());
m_CBasePage.AddItem("fileName", dt.Rows[j]["fileName"].ToString());
m_CBasePage.ItemOk();
}
}
m_CBasePage.totlalCount = files.Length;
jsonstr = m_CBasePage.ToString();
}
return jsonstr;
}