protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; string uid = Request.QueryString["uid"]; string cak = Request.QueryString["callback"]; int ret = 0; //参数为空 if (!string.IsNullOrEmpty(id)) { DBFile.complete(id); FileInf folder = new FileInf(); folder.id = id; DBFile.read(ref folder); //扫描文件夹 fd_scan sc = new fd_scan(); sc.scan(folder); //合并完毕 DBFile.merged(id); ret = 1; //触发事件 up7_biz_event.folder_post_complete(id); } Response.Write(cak + "(" + ret + ")"); }
void folder_complete() { string id = Request.QueryString["id"]; string uid = Request.QueryString["uid"]; string cak = Request.QueryString["callback"]; int ret = 0; if (string.IsNullOrEmpty(id) || uid.Length < 1) { } else { FileInf inf = new FileInf(); DBFile db = new DBFile(); db.read(id, ref inf); string root = inf.pathSvr; //上传完毕 DBFile.fd_complete(id, uid); //扫描文件夹结构, fd_scan sa = new fd_scan(); sa.root = inf;// sa.scan(inf, root); //更新扫描状态 SqlExec se = new SqlExec(); se.update("up6_folders", new SqlParam[] { new SqlParam("f_scan", true) }, new SqlParam[] { new SqlParam("f_id", id) , new SqlParam("f_uid", uid) }); up6_biz_event.folder_post_complete(id); ret = 1; } PageTool.to_content(cak + "(" + ret + ")"); }
protected void Page_Load(object sender, EventArgs e) { string id = this.reqString("id"); string uid = this.reqString("uid"); string cak = this.reqString("callback"); int cover = this.reqToInt("cover"); int ret = 0; if (string.IsNullOrEmpty(id) || uid.Length < 1) { } else { DbFolder db = new DbFolder(); FileInf folder = db.read(id); folder.uid = int.Parse(uid); FileInf fdExist = db.read(folder.pathRel, folder.pid, id); if (1 == cover && fdExist != null) { folder.id = fdExist.id; folder.pid = fdExist.pid; folder.pidRoot = fdExist.pidRoot; } //根节点 FileInf root = new FileInf(); root.id = folder.pidRoot; root.uid = folder.uid; //当前节点是根节点 if (string.IsNullOrEmpty(root.id)) { root.id = folder.id; } //上传完毕 DBConfig cfg = new DBConfig(); DBFile dbf = cfg.db(); dbf.fd_complete(id, uid); //扫描文件夹结构, fd_scan sa = cfg.sa(); sa.root = root;// //清理同名子文件 if (1 == cover && fdExist != null) { //覆盖同名子文件 sa.cover(folder, folder.pathSvr); } //添加文件记录 sa.scan(folder, folder.pathSvr); //更新扫描状态 dbf.fd_scan(id, uid); up6_biz_event.folder_post_complete(id); //删除当前目录 if (1 == cover && fdExist != null) { cfg.folder().del(id, int.Parse(uid)); } ret = 1; } this.toContentJson(cak + "(" + ret + ")"); }