www.gusucode.com > 深度梦想整站系统(asp) 1.14.02源码程序 > admin/soft/soft_DEL.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
projectRootPath = "../../"	'相对当前应用程序根的位置
%>
<!-- #include file="../web.config.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="robots" content="noindex,nofollow" />
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>管理</title>
    
	    <link href="../themes/<%=theme_Path%>/main.css" rel="stylesheet" type="text/css" />
</head>

<body  id="bodyBg1">
<br />
&nbsp; <a href="soft_Manage.asp">下载管理</a> | <a href="soft_Add.asp">添加下载</a>
<hr class="Nav-hr" />
<br />

<dl class="manageContent">
    <dt>下载管理</dt>
    <dd>
    	<br />

<%
selectDelID=Request.Form("selectDel")

if selectDelID <> "" then

	aryID=split(selectDelID,",")
	for each id in aryID
	
	Set rsSoft=Server.CreateObject("Adodb.Recordset")
	SqlDEL="Select * from deep_Soft where fid=" & id
	rsSoft.open SqlDEL,conn,3,2
	

	If not IsObjInstalled("Scripting.FileSystemObject") Then
		Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能删除关联软件</font></b>"
	else

		'下载地址
		if(rsSoft("fDownloadUrl")<>"")then
			arrDownloadUrls=split(rsSoft("fDownloadUrl"),"$$$")
			for each DownloadUrl in arrDownloadUrls
			  arrDownloadUrl=split(DownloadUrl,"|")
			  'response.Write("<option value='"&DownloadUrl&"'>"&DownloadUrl&"</option>")	
			  
			  if arrDownloadUrl(1)<>"" then
				  Dim DelDownloadUrl
				  DelDownloadUrl = projectRootPath & site_upFilesDir &"soft/" & arrDownloadUrl(1)
				  Call DoDelFile(DelDownloadUrl)
			  end if
					
			next
		end if
	end if
	
	if rsSoft("fuploadFiles")<>"" then
		If not IsObjInstalled("Scripting.FileSystemObject") Then
			Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能删除关联图片</font></b>"
		else
			' 把带"|"的字符串转为数组,用于初始下拉框表单
			Dim aSavePicPathFileName
			aSavePicPathFileName = Split(rsSoft("fuploadFiles"), "|")
			For i = 0 To UBound(aSavePicPathFileName)
				Call DoDelFile( projectRootPath&aSavePicPathFileName(i) )
			Next
		end if
	end if
	
	rsSoft.delete
	rsSoft.update
		
	rsSoft.close
	Set rsSoft=Nothing
	'Call CloseConnDB()
	Response.Write("软件("&id&")成功删除!!!<br />")
	next
else
	Response.Write("<p align='center'>软件未删除!!!</p>")
end if

' 删除指定的文件
Sub DoDelFile(sPathFile)
	On Error Resume Next
	Dim oFSO
	Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
	oFSO.DeleteFile(Server.MapPath(sPathFile))
	Set oFSO = Nothing
End Sub

'**************************************************
'函数名:IsObjInstalled
'作  用:检查组件是否已经安装
'参  数:strClassString ----组件名
'返回值:True  ----已经安装
'       False ----没有安装
'**************************************************
Function IsObjInstalled(strClassString)
	On Error Resume Next
	IsObjInstalled = False
	Err = 0
	Set xTestObj = Server.CreateObject(strClassString)
	If 0 = Err Then IsObjInstalled = True
	Set xTestObj = Nothing
	Err = 0
End Function

%>
        <br />
        <br />
    </dd>
</dl>
<br />

</body>
</html>
<%
call closeConnDB()
%>