⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 song.asp

📁 关于聊天系统的源代码 asp编程 未完整版
💻 ASP
字号:
<%@ LANGUAGE=VBScript%>
<%
Response.Buffer = True
Sub Msg (v)
 Response.Write "<script Language=JavaScript>alert('" & v & "');history.go(-1);</script></body></html>"
 Response.End
End Sub
If not isarray(session("dv_user")) Then Msg "必须进入聊天室才能点歌!"
dv_user=session("dv_user")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
sj=n & "-" & y & "-" & r
zj = Request.QueryString("zj")
zj = Replace(zj, ".", "")
zj = Replace(zj, "/", "")
zj = Replace(zj, "\", "")
zj = Replace(zj, "?", "")
zj = Replace(zj, ":", "")
zj = Replace(zj, "|", "")
zj = Replace(zj, Chr(34), "")
%>
<html>
<head>
<title>点歌系统</title>
<meta http-equiv='content-type' content='text/html; charset=gb2312'>
<script>
var winbgcolor = parent.cbg();
var winbgimage = parent.cbi();
document.writeln("<body bgcolor=" + winbgcolor + " background=" + winbgimage + " bgproperties=fixed topmargin=3>");
var zj = "<%=zj%>";
function gozj(){
 url="song.asp?zj=" + document.songlist.songzj.options[document.songlist.songzj.selectedIndex].value;
 this.location.href=url;
}
function wz(v){
 if(v == zj){
  document.write("<option value=\"" + v + "\" Selected>" + v + "</option>");
 }
 else{
  document.write("<option value=\"" + v + "\">" + v + "</option>");
 }
}
function check(){
 if(document.songlist.song.selectedIndex == -1){
  alert("请选择所需曲目。");
  return false;
 }
}
function ws(v){
 var newv = escape(v);
 var fv = v.substring(0, v.lastIndexOf("."));
 if(newv == v || v.indexOf("'") != -1){
  if(fv.length > 11){fv = fv.substring(0,11) + "…"}
  document.write("<option value=\"" + v + "\">" + fv + "</option>");
 }
 else{
  if(fv.length > 5){fv = fv.substring(0,5) + "…"}
  document.write("<option value=\"" + v + "\">" + fv + "</option>");
 }
}
function s(){
 if(document.songlist.song.selectedIndex == -1){
  alert("请选择所需曲目。");
  return false;
 }
 v = document.songlist.song.options[document.songlist.song.selectedIndex].value;
 v = v.substring(0, v.lastIndexOf("."));
 while(v.indexOf("_") != -1){v = v.replace("_"," ")}
 alert("完整曲名:[ " + v + " ]");
}
function playsong(){
 if(document.songlist.song.selectedIndex == -1){
  alert("请选择所需曲目。");
  return false;
 }
 zj = document.songlist.songzj.options[document.songlist.songzj.selectedIndex].value;
 sn = document.songlist.song.options[document.songlist.song.selectedIndex].value;
 if(document.songlist.loopok[1].checked){
  cs = "infinite";
  csn = "百听不厌";
 }
 else{
  cs = "1";
  csn = "只听一遍";
 }
 url = parent.ph + "mid/" + escape(zj) + "/" + escape(sn);
 ext = sn.substring(sn.lastIndexOf(".") + 1, sn.length);
 if(ext == "rm" || ext == "ram" || ext == "wma"){
  var myn = '<%=dv_user(0)%>';
  if(ext == "wma"){
   player = "媒体播放机";
  }
  else{
   player = "RealPlayer";
  }
  
  parent.getmsg(myn,myn,0,"<font color=black>【点歌】</font>正在调用 <font color=red>"+player+"</font> 播放曲目<font color=A00000>《" + sn.substring(0, sn.lastIndexOf(".")) + "》</font>,如果您没有安装 <font color=red>"+player+"</font> 将不能播放。",'2','000000','0088FF','0','<%=time()%>');
 // parent.song.location.href = url;
  var songplaywindow = window.open('about:blank', '', 'width=340,height=100');
  songplaywindow.document.open();
  songplaywindow.document.writeln("<html><title>播放器</title><style type=text/css>body{font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>");
  songplaywindow.document.writeln("<embed src=\"" + url + "\" width=100% height=100% nojava='true' autostart='True'></embed>");
  songplaywindow.document.writeln("<div id='Layer1' style='position:absolute; left:-800px; top:-800px; width:0px; height:0px; z-index:1'><input type=button name=btc value='关闭(Q)' accesskey='q' onClick='top.window.close();'></div>");
  songplaywindow.document.writeln("</body></html>");
  songplaywindow.document.close();
 
 }
 else{
  parent.f8.document.open();
  parent.f8.document.writeln("<bgsound src=\"" + url + "\" loop=" + cs + ">");
  parent.f8.document.close();
  var myn = '<%=dv_user(0)%>';
  parent.getmsg(myn,myn,0,"<font color=black>【点歌】</font>正在下载并播放曲目<font color=A00000>《" + sn.substring(0, sn.lastIndexOf(".")) + "》</font>,播放方式:<font color=A00000>" + csn + "</font>,请稍候……",'2','000000','0088FF','0','<%=time()%>');
 }
}
function stopsong(){
 parent.f8.location.href = "about:blank";
}
</script>
<style type="text/css">
A:visited{TEXT-DECORATION: none;Color:#000000}
A:active{TEXT-DECORATION: none;Color:#000000}
A:hover{TEXT-DECORATION: underline;Color:#000000}
A:link{text-decoration: none;Color:#000000}
.t{LINE-HEIGHT: 1.4}
BODY{FONT-FAMILY: "宋体"; FONT-SIZE: 12px;
}
TD,p,div,br{FONT-FAMILY: "宋体"; FONT-SIZE: 12px;Color:#000000;}
FORM{FONT-FAMILY: "宋体"; FONT-SIZE: 12px}
OPTION{FONT-FAMILY: "宋体"; FONT-SIZE: 12px}
INPUT{BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc; font-family: "宋体"; font-size: 12px}
textarea {border-width: 1; border-color: #000000; background-color: #efefef; font-family: "宋体"; font-size: 12px; font-style: bold;}
select {border-width: 1; border-color: #000000; background-color: #eeeeee; font-family: "宋体"; font-size: 12px; font-style: bold;}
</style>
</head>
<script>
var winbgcolor = parent.cbg();
var winbgimage = parent.cbi();
document.writeln("<body bgcolor=" + winbgcolor + " background=" + winbgimage + " bgproperties=fixed topmargin=3>");
</script>
<div align=center><font color="#FFFF00" style="font-size:12pt">点歌系统</font></div>
<hr size=1 color=FFFF00>
<table border="0" width="100%">
<form method="post" action="hqtchat420.asp" name="songlist" onsubmit="return(check())">
<tr>
<td> 
<div>
<p><a href="javascript:history.go(0)" title="显示最新的曲目列表"><font color="#FFFFFF">刷新:<%=sj%></font></a></p>
<p><font color="#FFFF00">选择专辑:</font><br>
<select name="songzj" onchange="javascript:gozj()">
<%
Set fs=CreateObject("Scripting.FileSystemObject")
zjpath=Server.Mappath("mid")
Set f=fs.GetFolder(zjpath)
Set fc=f.SubFolders
sss=0
For Each f1 in fc
fn=f1.name
if zj="" and sss=0 then zj=fn
sss=sss+1
Response.Write "<script>wz(" & chr(34) & fn & chr(34) & ");</script>" & chr(13) & chr(10)
next
%>
</select>
</p>
</div>
<p>
<font color="#FFFF00">选择曲目:</font><br>
          <select name="song" size="9">
<option>------------</option>
<%
songpath=Server.Mappath("mid/"&zj)
Set f=fs.GetFolder(songpath)
Set fc=f.Files
For Each f1 in fc
fn=f1.name
Response.Write "<script>ws(" & chr(34) & fn & chr(34) & ");</script>" & chr(13) & chr(10)
next
Set f=nothing
Set fc=nothing
Set fs=nothing
%>
          </select>
</p>
<p><font color="#FFFF00">播放方式:</font><br>
<input type="radio" name="loopok" value="1" checked>
只听一遍<br>
<input type="radio" name="loopok" value="infinite">
百听不厌</p>
<table border="0" cellpadding="4">
<tr> 
<td> 
<input type="button" name="play" value="播放" onclick="javascript:playsong()">
</td>
<td align="right"> 
<input type="button" name="st" value="停止" onclick="javascript:stopsong()">
</td>
</tr>
<tr> 
<td colspan="2"> 
<input type="button" value="完整的曲名" onClick="Javascript:s()" name="san">
</td>
</tr>

</table>
</td>
</tr>
</form>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -