/// <summary> /// 删除任务 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GamePlaceList_ItemCommand(object sender, ListViewCommandEventArgs e) { LabelMessage.Text = ""; if (e.CommandName == "del") { string recid = e.CommandArgument.ToString(); string sql = string.Format(@"select gi.*,npct.CreateTaskID,npct.PackageName,npct.PackageTaskStatus from {1} npct inner join sdk_GameInfo gi on npct.GameID=gi.GameID and npct.RecID={0}", recid, systemname == "Android" ? "sdk_NewPackageCreateTask" : "sdk_NewPackageCreateTask_IOS"); DataSet ds = aideNativeWebFacade.GetDataSetBySql(sql); if (ds.Tables[0].Rows.Count > 0) { string filePath = ""; string logPath = ""; string gamename = ds.Tables[0].Rows[0]["GameName"].ToString(); string createtaskid = ds.Tables[0].Rows[0]["CreateTaskID"].ToString(); string gamenamespell = ds.Tables[0].Rows[0]["GameNameSpell"].ToString(); string packagename = ds.Tables[0].Rows[0]["PackageName"].ToString(); string packagetaskstatus = ds.Tables[0].Rows[0]["PackageTaskStatus"].ToString(); if (systemname == "Android") { filePath = System.Configuration.ConfigurationManager.AppSettings["SDKAndroidPackageApk"] + gamename + "\\" + createtaskid + "\\";// + packagename; logPath = System.Configuration.ConfigurationManager.AppSettings["SDKAndroidPackageLogs"] + createtaskid + "\\"; } else { filePath = System.Configuration.ConfigurationManager.AppSettings["SDKIOSPackageIPA"] + gamenamespell + "\\" + createtaskid + "\\"; logPath = System.Configuration.ConfigurationManager.AppSettings["SDKIOSPackageLogs"] + createtaskid + "\\"; } try { if (packagetaskstatus == "3") { int fileNo = System.IO.Directory.GetFileSystemEntries(filePath).Length; if (fileNo > 1) { System.IO.File.Delete(filePath + packagename); } else { System.IO.Directory.Delete(filePath, true); } //if (System.IO.Directory.Exists(filePath)) //if (System.IO.Directory.Exists(logPath)) int logNo = System.IO.Directory.GetFileSystemEntries(logPath).Length; if (logNo > 1) { System.IO.File.Delete(logPath + recid + ".log"); } else { System.IO.Directory.Delete(logPath, true); } } aideNativeWebFacade.DeleteNewPackageTask(Convert.ToInt32(recid), systemname); this.GamePlaceList.DataBind(); } catch (Exception ex) { LabelMessage.Text = ex.Message; return; } } else { LabelMessage.Text = "未找到关联数据:无法执行删除!"; } } }