组保留的标签 余下为需要删除的标签
unset($oldtag[$key]);
}
}
}
if (!empty($oldtag)) {
$tagids = array();
foreach ($oldtag as $tagid => $tagname) {
$tagids[] = $tagid;
}
well_oldtag_delete($tagids, $tid);
}
$r = well_tag_process($tid, $fid, $create_tag, $tagarr);
return $r;
}
// 删除标签和绑定的主题
function well_oldtag_delete($tagids, $tid)
{
$pagesize = count($tagids);
$arrlist = well_tag_find_by_tagids($tagids, 1, $pagesize);
$delete_tagids = array(); // 删除
$tagids = array();
$n = 0;
foreach ($arrlist as $val) {
++$n;
if (1 == $val['count']) {
// 只有一个主题
$delete_tagids[] = $val['tagid'];
} else {
$tagids[] = $val['tagid'];
}
}
!empty($delete_tagids) and well_tag_delete($delete_tagids);
$arlist = well_tag_thread_find_by_tid($tid, 1, $n);
if ($arlist) {
$ids = array();
foreach ($arlist as $val) $ids[] = $val['id'];
well_tag_thread_delete($ids);
}
!empty($tagids) and well_tag_update($tagids, array('count-' => 1));
}
// 标签数据处理 $arr=新提交的数组 $tagarr=保留的旧标签
function well_tag_process($tid, $fid, $new_tags = array(), $tagarr = array())
{
if (empty($tid)) return '';
// 新标签处理入库
if ($new_tags) {
$threadarr = array();
$tagids = array();
$i = 0;
$size = 5;
$n = count($tagarr);
$n = $n > $size ? $size : $size - $n;
foreach ($new_tags as $name) {
++$i;
$name = trim($name);
$name = stripslashes($name);
$name = strip_tags($name);
$name = str_replace(array(' ', '#', "@", "$", "%", "^", '&', '·', '<', '>', ';', '`', '~', '!', '¥', '……', ';', '?', '?', '-', '—', '_', '=', '+', '.', '{', '}', '|', ':', ':', '、', '/', '。', '[', ']', '【', '】', '‘', ' ', ' ', ' ', ' ', ' '), '', $name);
$name = htmlspecialchars($name, ENT_QUOTES);
if ($name && $i <= $n) {
// 查询标签
$read = well_tag_read_name($name);
if ($read) {
// 存在 count+1
$tagids[] = $read['tagid'];
} else {
// 入库
$arr = array('name' => $name, 'count' => 1);
$tagid = well_tag_create($arr);
FALSE === $tagid and message(-1, lang('create_failed'));
$read = array('tagid' => $tagid, 'name' => $name);
}
$tag_thread = array('tagid' => $read['tagid'], 'tid' => $tid);
$threadarr[] = $tag_thread;
$tagarr[$read['tagid']] = $read['name'];
}
}
!empty($threadarr) and tag_thread_big_insert($threadarr);
!empty($tagids) and well_tag_update($tagids, array('count+' => 1));
}
$json = empty($tagarr) ? '' : xn_json_encode($tagarr);
return $json;
}
?>
系统提示“更新服务被禁用”,如何启用?-阿南达文事网
系统提示“更新服务被禁用”,如何启用?
编程日记00
更新时间:2025-05-26 09:26:08 系统提示“更新服务被禁用”,如何启用?
方法一:通过服务管理器启用更新服务
- 步骤:
- 打开“服务”管理器:
- 按下
Win + R
键,输入services.msc
,然后按回车。
- 找到以下服务并确保其状态为“正在运行”:
- Windows Update
- Background Intelligent Transfer Service (BITS)
- Cryptographic Services
- Windows Installer
- 如果服务未运行,右键单击并选择“启动”。
- 将启动类型设置为“自动”,以确保服务在系统启动时自动运行。
方法二:通过组策略启用更新服务
- 适用场景: Windows专业版或更高版本。
- 步骤:
- 打开“组策略编辑器”:
- 按下
Win + R
键,输入gpedit.msc
,然后按回车。
- 导航到以下路径:计算机配置 -> 管理模板 -> Windows 组件 -> Windows 更新
- 双击“配置自动更新”。
- 确保未选择“已禁用”,选择适当的更新安装方式(如选项3或选项4)。
- 点击“应用”和“确定”。
方法三:通过注册表编辑器启用更新服务
- 注意: 修改注册表可能导致系统不稳定,请谨慎操作并备份注册表。
- 步骤:
- 打开“注册表编辑器”:
- 按下
Win + R
键,输入regedit
,然后按回车。
- 导航到以下路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv
- 找到右侧的“Start”键值,双击并将其数值数据设置为
2
(表示自动启动)。 - 重复上述步骤,确保以下服务也设置为自动启动:
方法四:重置 Windows 更新组件
- 步骤:
- 打开“命令提示符”(管理员权限):
- 按下
Win + X
键,选择“Windows终端(管理员)”或“命令提示符(管理员)”。
- 输入以下命令以停止相关服务:net stop wuauserv net stop bits net stop appidsvc net stop cryptsvc
- 导航到以下文件夹并重命名相关文件夹以清除缓存:ren C:\Windows\SoftwareDistribution SoftwareDistribution_old ren C:\Windows\System32\catroot2 catroot2_old
- 输入以下命令以重新启动服务:net start wuauserv net start bits net start appidsvc net start cryptsvc
本文发布于:2025-05-26,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:系统提示“更新服务被禁用”,如何启用
发布评论