<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../include/connect.asp" -->
<%
videoid=Checkstr(request.querystring("videoid"))

set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLVideo where VideoID="&videoid&""
rs.open sql,cn,1,1

if rs.eof or rs.bof then
Response.write("<script>alert('找不到此视频！');history.back(-1);</script>")
Response.end()
elseif rs("Username") <> session("username") then
Response.write("<script>alert('您没有权限！');window.location.replace('videolist.asp?Username="&rs("Username")&"&viewmode=1');</script>")
rs.close
set rs=nothing
Response.end()
end if

cn.execute ("delete from Show5_ALLVideo where VideoID="&videoid&"")
cn.execute ("delete from Show5_Videocomment where VideoID="&videoid&"")

Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
fso.DeleteFile("F:\UserVideo\"&rs("Username")&"\"&rs("Filename")&".flv")
fso.DeleteFile("E:\Wwwroot\show5net\Videoimage\"&rs("Filename")&".jpg")
fso.close
set fso=nothing
Response.write("<script>alert('成功删除视频！');window.location.replace('videolist.asp?Username="&rs("Username")&"&viewmode=1');</script>")
rs.close
set rs=nothing
%>
