62,243
社区成员




<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:Button ID="btnChange" runat="server" Text="下一首" OnClick="btnChange_Click" />
</div>
</form>
<embed id="Em1" src="<%=Url%>" width="300" autostart="true' loop="true" height="45" type="audio/x-pn-realaudio-plugin" visible="false"> </embed>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebPlayMp3App
{
public partial class WebForm1 : System.Web.UI.Page
{
public string Url = "AlarmMusic/无声.mp3";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnChange_Click(object sender, EventArgs e)
{
//如何更换?
Url = "AlarmMusic/AlarmMusic1.mp3";
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Url = "AlarmMusic/AlarmMusic1.mp3";
}
}
}