为什么我的语音妈验证不能响啊

ly0228 2017-05-24 06:19:18
<title>语音验证码</title>
<script type="text/javascript">
function say() {
PageMethods.getPath(callserver); //回调后台方法生成新的播放列表
}
function callserver(result) {//处理返回值的函数,参数是播放列表的相对路径
if (result != "") {//如果有返回值
var wmp = document.getElementById('hongchen'); //获取播放器对象
wmp.url = "/" + result + "?t=" + Math.random(); //设置播放器的播放路径是网络播放列表地址
wmp.settings.playCount = 1; //设置只播放一次
wmp.controls.play(); //开始播放
}
}
function changeImg() {//刷新验证码
document.getElementById("img").src = document.getElementById("img").src + "?";
}
function delList() {//删除所有客户端在服务器中的历史播放列表
PageMethods.deleteAllList(); //回调服务器端得方法
}
</script>
<script type="text/javascript">
function Myenter() {
if (event.keyCode == 13 && event.srcElement.type != 'submit') {
event.keyCode = 9;
}
}
</script>
</head>
<body background="imagemy/003.jpg">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<div id="b" align="center">

<div>
<object classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' id='hongchen' style="display:none">
<param name='volume' value='100'/>
<param name='playcount' value='100'/><%--控制重复次数: “x”为几重复播放几次--%>
<param name='enableerrordialogs' value='0'/><%--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放--%>
<param name='ShowStatusBar' value='0'/>
<param name='url' value=" "/><%--播放的文件地址--%>
<param name='autoStart' value="0"/><%--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放--%>
</object>
<br />
<br />
<br />
public static string getPath()
{
string mypath = string.Empty;
string checkCode = HttpContext.Current.Request.Cookies["CheckCode"].Value;
char[] codes = checkCode.ToCharArray();
if (checkCode != "")
{
string dirPath = HttpContext.Current.Server.MapPath("asx");
string path = "asx/" + System.Web.HttpContext.Current.Request.UserHostName + DateTime.Now.Millisecond + ".wpl";
string listPath = HttpContext.Current.Server.MapPath(path);
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
StreamWriter sw = File.AppendText(listPath);
mypath = path;
sw.WriteLine("<?wpl version='1.0'?>");
sw.WriteLine("<smil>");
sw.WriteLine("<head>");
sw.WriteLine("</head>");
sw.WriteLine("<body>");
sw.WriteLine("<seq>");
sw.WriteLine("<media src='/sound/begin.mp3' />");
for (int i = 0; i < codes.Length; i++)
{
sw.WriteLine("<media src='/sound/" + codes[i] + ".mp3' />");
}
sw.WriteLine("<media src='/sound/end.mp3' />");
sw.WriteLine("</seq>");
sw.WriteLine("</body>");
sw.WriteLine("</smil>");
sw.Dispose();
sw.Close();
}
return mypath;
}
[System.Web.Services.WebMethod]
public static void deleteAllList()
{
string ip = System.Web.HttpContext.Current.Request.UserHostName;
string path = HttpContext.Current.Server.MapPath("asx");
if (System.IO.Directory.Exists(path))
{
string[] files = System.IO.Directory.GetFiles(path);
for (int i = 0; i < files.Length; i++)
{
if (System.IO.Path.GetFileName(files[i]).Substring(0, ip.Length) == ip)
{
System.IO.File.Delete(files[i]);
}
}
}
}
...全文
165 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧