protected void btn_Click(object sender, EventArgs e)
{
string strSql = "select*from lmb ";
DataTable dt = new DataTable();
new SQLHelper().ExecuteSql(strSql, out dt);
foreach (DataRow dr in dt.Rows)
{
string filepath = Server.MapPath("~" + dr["lmlj"].ToString());
if (!Directory.Exists(filepath))
{
Directory.CreateDirectory(filepath);
}
}
Response.Write("<script>alert('" + dt.Rows[0]["lmmc"].ToString() + "文件夾生成完畢!')</script>");
}
protected void btnDel_Click(object sender, EventArgs e)
{
string strSql = "select*from lmb ";
DataTable dt = new DataTable();
new SQLHelper().ExecuteSql(strSql, out dt);
dt.Rows.Remove(dt.Rows[0]);
foreach (DataRow dr in dt.Rows)
{
string filepath = Server.MapPath("~" + dr["lmlj"].ToString());
if (filepath != "")
{
if (Directory.Exists(filepath))
{
Directory.Delete(filepath);
}
}
}
}