最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
我在桌面上删帖子
时间:2022-06-30 11:21:39 编辑:袖梨 来源:一聚教程网
'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 "删除成功 !"
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 "删除成功 !"
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20