当前位置:编程学习 > asp >>

asp播放音乐代码

asp播放音乐代码,这个代码是从数据库中读取音乐的地址然后给播放器.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
check()
dim id,sql
id=html_encode(request.QueryString("id"))
if not isnumeric(id) or id="" then
response.Write("<script language='javascript'>alert('非法操作了,这样不能战歌.');history.back();</script> ")
else
sql="select title,id,say,zp_path from music where id="&id
updatesql="update music set hit=hit+1 where id="&id
call opendb()
set rs=cn.execute(sql)
if not rs.eof then
cn.execute(updatesql)
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs("title")%></title>
<style type="text/css">
<!--
body {
 margin-left: 2px;
 margin-top: 2px;
 margin-right: 2px;
 margin-bottom: 2px;
}
-->
</style></head>

<body>

<table width="98" border="0" align="center" cellspacing="1" bgcolor="#0099cc">
  <tr>
    <td height="28" background="img/play.gif"><table width="100%" height="28"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33%" align="left"> </td>
        <td width="60%"> </td>
        <td width="7%" align="center"><table width="22" height="21" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td onMouseOver="this.style.backgrond='img/down.gif';" onMouseOut="this.style.background='img/playclose.gif';"><a href="javascript:window.close();"><img src="img/playclose.gif" width="21" height="22" border="0"></a></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="300" align="center" valign="top" bgcolor="#FFFFFF"><table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td> </td>
      </tr>
      <tr>
        <form name="form1" method="post" action=""> <td align="center">
        
            <textarea name="textarea" cols="60" rows="17" style="background:url(photo/2006111447439849.JPG)"><%=encode_html(rs("say"))%></textarea>
          </td>
        </form>
      </tr>
      <tr>
        <td> </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><object classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" width=450 height=45 align="middle" id="mPlayer1">
      <param name="invokeURLs" value="0">
      <!--脚本命令设置:是否调用URL-->
      <param name="URL" value="<%=encode_html(rs("zp_path"))%>">
      <param name="rate" value="1">
      <param name="balance" value="0">
      <param name="currentPosition" value="0">
      <param name="defaultFrame" value>
      <param name="playCount" value="100">
      <param name="autoStart" value="-1">
      <param name="currentMarker" value="0">
      <param name="invokeURLs" value="-1">
      <param name="baseURL" value>
      <param name="volume" value="100">
      <param name="mute" value="0">
      <param name="uiMode" value="full">
      <param name="stretchToFit" value="0">
      <param name="windowlessVideo" value="0">
      <param name="enabled" value="-1">
      <param name="enableContextMenu" value="-1">
      <param name="fullScreen" value="0">
      <param name="SAMIStyle" value>
      <param name="SAMILang" value>
      <param name="SAMIFilename" value>
      <param name="captioningID" value>
      <param name="enableErrorDialogs" value="0">
      <param name="_cx" value="7779">
      <param name="_cy" value="1693">
    </object></td>
  </tr>
</table>
<%
else
response.Write("<script language='javascript'>alert('对不起,这首歌可能己被删除!');history.back();</script> ")
end if
end if%>
</body>
</html>

注明:转载请说明出处www.226500.cn

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,