asp如何在网站上提供音乐下载?

时间:2010-06-22 21:14:00 

如何在网站上提供音乐下载?

为用户提供歌曲下载,一般有两种方式,一是直接通过Http,浏览器下载,二是通过ftp协议下载。我们来用Http和浏览器下载做一个看看:

<%
id=request(“id")
set tdb=server.createobject(“adodb.connection")
tdb.open “music"
SQL=“select mp3url from music where id ="&id
' 获得歌曲id
set tset=tdb.execute(SQL)
if tset.eof then 
response.end
else
SQL=“update music set total_down=total_down
+1 where id ="&id
tdb.execute(SQL)
downfile=tset(“url")
' 本例可在数据库中对下载次数进行跟踪记录.此语句是更新数据库中歌曲的下载次数
tdb.close
set tset=nothing
set tdb=nothing
end if
if downfile=“" or isnull(downfile) then response.end
downfile=“http://"+downfile
response.redirect(downfile)
' 下载相应歌曲
response.end
%>

标签:下载,音乐,asp
0
投稿

猜你喜欢

  • asp检测表单输入EMAIL合法性的函数

    2007-10-16 13:39:00
  • 怎样在SQL Server中去除表中不可见字符

    2009-02-05 15:23:00
  • sqlserver数据库迁移后,孤立账号解决办法

    2011-10-24 20:01:40
  • asp如何设置cookie的过期时间

    2008-02-29 13:36:00
  • MySQL数据库性能优化之索引优化

    2012-05-08 07:16:37
  • 设计师的底线

    2009-05-06 12:51:00
  • 中英文双语导航菜单

    2007-05-11 17:04:00
  • Frontpage轻松下载网页或站点

    2007-10-22 13:14:00
  • asp如何实现按照输入汉字提示拼音功能?

    2010-05-18 18:37:00
  • 利用xslt对xml进行缩进格式化处理

    2008-09-04 10:34:00
  • MySQL中XML数据的XPath支持

    2009-12-15 21:57:00
  • FCKeditor 编辑器实战技巧 Ⅰ

    2008-10-08 10:22:00
  • Excel和Access之间的数据交换

    2008-11-20 16:53:00
  • 用"表情符号"做植入广告 是否可行呢?

    2009-02-23 13:07:00
  • AJAX无刷新验证用户名是否存在

    2007-08-10 10:07:00
  • 浅谈图表参数化设计

    2010-08-29 18:03:00
  • asp连接mssql2005的代码

    2011-03-29 11:11:00
  • firefox与ie 的javascript区别

    2010-03-14 11:30:00
  • MySQL字段类型详解

    2009-01-05 09:23:00
  • ASP 游标参数详解(ASP记录集)第1/2页

    2011-04-08 11:04:00
  • asp之家 网络编程 m.aspxhome.com