del.vbs
option explicit
dim message,result
dim title,text1,text2
message="请输入要删除帖子的id"
title="帖子删除"
text1="你取消了操作!"
result =inputbox(message,title,"请输入要删除帖子的id")
if result ="" then
wscript.echo text1
elseif isnumeric(result)=false then
wscript.echo "请输入正确的id!"
elseif trim(cint(result))<>trim(result) then
wscript.echo "请输入正确的id!"
else
dim result1
result1=msgbox("你确定要删除帖子"&result&vbcrlf&"这一操作将删除帖子本身及帖子的所有子贴",48+1+256,"按 确定 删除,按 取消 放弃!")
if result1=vbok then
dim conn
set conn = wscript.createobject("adodb.connection")
conn.open"driver={sql server};server=111.111.111.111;uid=11;pwd=11;"&"database=11;"
dim sql,rs,sql2,rs2,sql3
sql="select rootid,deep,ordernum from bbs where mianid ="&cint(result)
set rs=conn.execute(sql)
if not rs.eof then
if rs(0)=0 then
sql3="delete bbs where rootid="&result&" or mianid= "&result
else
sql2="select top 1 ordernum from bbs where rootid="&rs(0)&" and deep<="&rs(1)&" and ordernum >"&rs(2)&"order by ordernum "
set rs2=conn.execute(sql2)
if not rs2.eof then
sql3="delete bbs where ordernum >="&rs(2)&" and ordernum < "&rs2(0)&" and rootid="&rs(0)
else
sql3="delete bbs where ordernum >="&rs(2)&" and rootid="&rs(0)
end if
end if
dim introws
conn.execute(sql3),introws
if introws >0 then
wscript.echo "删除成功 !"
else
wscript.echo "删除失败 !"
end if
else
wscript.echo"你要删除的帖子不存在!"
end if
else
wscript.echo "你放弃了删除!"
end if
end if
我在桌面上删帖子
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 我在桌面上删帖子
相关推荐
- 暂无文章
