原来的那个页面是asp的,错误就是页面执行到某个程度就停止不动了,页面一直显示正在下载,但没有动静,查看源文件发现源文件没有执行到底部,而是不确定得停止在了某一点。我换成了ASP.NET但没想到这个故障依然如故?大家有碰到过这样的情况吗?谢谢!!
解决方案 »
- js操作ListBox出现回“发或回调参数无效”
- [2008/07/30]Gridview中插入记录问题总汇
- C#初始化属性?
- 请问大家开发过像126邮箱那样的多窗口操作的东西吗?
- 一面试题,各位高手请帮忙看一下,如何解决?
- 将表中的多个列绑定到DropDownList Web控件
- 在visual c#编写web页面时,如何控制在一个文本输入框输完数据后按回车键跳到下一个文本框?
- framework的安装问题!
- 如何将SQL中的存储过程的值(局部变量)取出了。
- 调用sQlserver的命令对数据库进行备份和恢复。且备份及恢复的路径仅限制与服务器。大虾请救命...
- 怎样使Windows2003支持cdosys发信组件!
- 为何报错不存在类型:MailMessage,书上就是这样啊。
你说的断点好像只在delphi里边听说过啊,。net里边有吗?
应该怎么弄?请指教!我想提醒大家的是程序应该没错的,也没有死循环,要不然也不会大部分时间都正常了。
+++++++++++++++++++++++++++++
<%@ page language="vb" debug="true"%>
<%@ import namespace="system.data"%>
<%@ import namespace="system.data.oledb"%>
<html>
<head>
<title><%=pagetitle%></title>
<META name="description" content="歌曲连放">
<META name="keywords" content="自动更换歌曲">
<style>
body,p,td,tr,table,a,button,input,textarea,select{font-size:9pt}
.box2 {font-size:9pt;background:#FFCCFF;color:#740A22}
</style></head>
<body bgcolor="#FCF0FD" topmargin=0 >
<table width=100% align=center cellpadding=0 cellspacing=0 border=0 bordercolor=black style="word-break:break-all">
<tr height=30>
<td align=center style="font-size:10.5pt;padding-top:10px">
<B>当前歌曲:<a href="listnews.asp?id=<%=songid%>"title='点击查看歌词 ID:<%=songid%>' target=_blank style="font-size:10.5pt"><asp:label id="songtitle" runat=server text='<%# vbsongtitle%>'/></a> [<a href="songlist.asp" title="碰到你不喜欢的歌手和歌曲?快来试试!" target=_blank style="font-size:10.5pt">选歌超市</a>]</B>
</td>
</tr>
</table>
<table width=100% align=center cellpadding=0 cellspacing=0 border=0 bordercolor=black style="word-break:break-all">
<form runat="server">
<tr height=30><td align=center id="whatstring" style="font-size:9pt">
<asp:dropdownlist id="songlist" runat=server autopostback=true OnSelectedIndexChanged="changsong" style="font-size:9pt"/>
</td></tr>
<tr>
</table>
<table width=100% align=center cellpadding=0 cellspacing=0 border=0 bordercolor=black style="word-break:break-all">
<tr height=30>
<td align=center>
<input type=button value="已播放<%=songcount%>" class=box2 onclick="javascript:if(confirm('系统记录您刚连续收听<%=songcount%>首歌曲,目前的随机播放将不重复这些歌曲!\n\n您现在想清空记录并重新收听所有歌曲吗?')){emptysong()}" title="系统记录您刚连续收听<%=songcount%>首歌曲,目前的随机播放将不重复这些歌曲。点击清空记录!">
<input type=button value="顺序" id=b1 onclick="javascript:if(myturn!=2){myturn=2;this.style.color='red';document.getElementById('b2').style.color='';document.getElementById('b3').style.color='';alert('OK,下首歌曲开始顺序播放!')}else{alert('顺序播放嘛,知道啦!')}" class=box2>
<input type=button value="随机" id=b2 onclick="javascript:if(myturn!=0){myturn=0;this.style.color='red';document.getElementById('b1').style.color='';document.getElementById('b3').style.color='';alert('OK,下首歌曲开始随机播放!')}else{alert('随机播放嘛,知道啦!')}" class=box2>
<input type=button value="指定" id=b3 onclick="javascript:if(myturn!=1){myturn=1;this.style.color='red';document.getElementById('b2').style.color='';document.getElementById('b1').style.color='';alert('OK,下首歌曲开始单曲重复!')}else{alert('单曲重复嘛,知道啦!')}" class=box2>
<input type=button value="换下首歌" onclick="javascript:changesong(0)" class=box2>
<input type=button value='主页播放' onclick="javascript:endsong()" class=box2 title="返回到主页进行播放">
<input type=button value='发表评论' onclick="javascript:window.open('listnews.asp?id=<%=songid%>','mycomment','')" class=box2 title="点击发表评论">
</td>
</tr>
</table>
<table width=100% align=center cellpadding=0 cellspacing=0 border=0 bordercolor=black style="word-break:break-all">
<tr></form>
<td align=center>
<object width='460' height='68' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id=Exobud>
<param name='FileName' value="<%=realsongurl%>">
<param name='ShowStatusBar' value='1'>
<param name='EnableContextMenu' value='0'>
<param name='Volume' value='0'>
</object>
</td>
</tr>
</table>
</body>
</html>
<script runat="server">
dim realsongurl,vbsongtitle,pagetitle as string
dim songid,songcount as long
sub page_load(sender as object,e as eventargs)
if request("delsong")="ok" then
Response.Cookies("oldsong").Value = ","
response.redirect("autosong.aspx")
end if
if not ispostback then
if request("id")<>"" or request("idtemp")<>"" or request("nextid")<>"" then
dim tempid2
if request("id")<>"" then tempid2=request("id")
if request("idtemp")<>"" then tempid2=request("idtemp")
if request("nextid")<>"" then tempid2=request("nextid")
if isnumeric(tempid2) then
binddata(tempid2)
else
binddata(0)
end if
else
binddata(0)
end if
end if
end sub
sub binddata(whatid)
dim connstr as string
connstr="provider=microsoft.jet.oledb.4.0;"
connstr &="Jet OLEDB:database password='xxxxxx';"
connstr &="data source="+server.mappath("mydata.asp")
dim objconn as new oledbconnection
objconn.connectionstring = connstr
try
objconn.open()
catch
response.write("出错了,错误如下:<BR>" & err.description)
err.clear()
response.end
end try
dim objcomm as new oledbcommand
objcomm.connection=objconn
dim mydataset as new dataset
dim mydataadapter as oledbdataadapter mydataadapter= new oledbdataadapter("select id,title,click,content from yule order by mid(title,6,instr(6,title,'-')-6) asc,id asc",objconn)
mydataadapter.fill(mydataset,"yule")
dim i,ii,tempid,okcountnumber,endcount as long
dim t1,t2 as datatable
t1=mydataset.tables(0)
t2=t1.clone()
ii=-1
if whatid<>0 then
tempid=whatid
for i= 0 to t1.rows.count-1
if tempid=t1.rows(i)(0) then
ii=i
exit for
end if
next
if ii=-1 then
tempid=getnum(t1.rows.count-1,0)
else
tempid=ii
end if
else
tempid=getnum(t1.rows.count-1,0)
end if
dim cookiestr as string
If Not Request.Cookies("oldsong") Is Nothing Then
cookiestr =Request.Cookies("oldsong").Value
End If
if cookiestr="" then cookiestr=","
if ii=-1 then''''随机''''''''''''检查COOKIES
while instr(cookiestr,","&cstr(tempid)&",")>0
response.write(cstr(tempid) &".<a href='autosong.aspx?idtemp="& t1.rows(tempid)("id") &"' title='切换歌曲'>"& t1.rows(tempid)("title") &"</a> jump "& DateTime.Now.tostring() &"<BR>")
tempid=getnum(t1.rows.count-1,0)
end while
i=tempid
else
i=ii
end if
if instr(cookiestr,","&cstr(i)&",")=0 then''''没有这首歌
cookiestr=cookiestr & cstr(i) & ","
Response.Cookies("oldsong").Value = cookiestr
end if
Response.Cookies("oldsong").Expires = dateadd("h",5,now())
Response.Cookies("itsingsongs").Value = "today"
Response.Cookies("itsingsongs").Expires = dateadd("h",5,now())
songcount=ubound(split(cookiestr,","))-1
realsongurl=getsong(t1.rows(i)("content"))
vbsongtitle=t1.rows(i)("title")
songid=t1.rows(i)("id")
pagetitle=vbsongtitle
songtitle.databind()
dim sqlstr as string="update yule set click=click+1 where id="& songid
objcomm.commandtext=sqlstr
objcomm.executenonquery()
If request("wrongsongid")<>"" Then
cookiestr =request("wrongsongid")
if isnumeric(cookiestr) then
sqlstr="insert into errsong(songid,time1,frompage) values("& cookiestr &",now(),'autosong.aspx')"
objcomm.commandtext=sqlstr
objcomm.executenonquery()
'response.write("已插入错误id"& cookiestr )
'response.end
end if
End If
i=i-50
if i<0 then i=t1.rows.count+i
dim drrow as datarow
for ii=0 to 100
drrow=t2.newrow()
drrow(0)=t1.rows(i)(0)
drrow(1)=t1.rows(i)(1)
drrow(2)=t1.rows(i)(2)
t2.rows.add(drrow)
i=i+1
if i>t1.rows.count-1 then i=0
next
songlist.items.clear()
songlist.Items.insert(0,new ListItem("附近百首歌曲列表:点击切换一次,然后随机!",""))
i=1
for each drrow in t2.rows
songlist.Items.insert(i,new ListItem(i.tostring()&".."&blanktitle(drrow("title"))&" ("&drrow("click")&")", drrow("id")))
i=i+1
next
objconn.close()
end sub
function blanktitle(str1) as string
dim tempstr
tempstr=replace(str1," "," ")
blanktitle= tempstr
end function
function getnum(m,n)''''M为最大数,N为最小数
randomize
dim a
a=rnd()
a=int((m-n+1)*a)+n
getnum=a
end function
function getsong(str1)
on error resume next
dim aaa,bbb
aaa=instr(str1,"[MP3]")
bbb=instr(str1,"[MP4]")
if aaa=0 or bbb=0 then
getsong="mysongs/bsr.wma"
exit function
end if
str1=mid(str1,aaa+5,bbb-aaa-5)
getsong=str1
end function
sub changsong(sender as object,e as eventargs)
if songlist.selecteditem.value<>"" then response.redirect("autosong.aspx?idtemp="& songlist.selecteditem.value)
end sub
</script>
<SCRIPT Language ="JavaScript" FOR=Exobud EVENT=EndOfStream()> nextsong();</SCRIPT>
<SCRIPT Language ="JavaScript" FOR=Exobud EVENT=error()>SongError(Exobud.ErrorCode); </SCRIPT>
<SCRIPT src="songaspx.js" Language ="JavaScript"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
if(!window.opener){location=''}
resizeMe();
rightbutton();
function DM(e)
{
if(!ns)
{if(event.button>1)window.external.addFavorite('http://www.itsing.net/',' 一心阁')}
else
{if(e.which>1)return false}
}
function rightbutton()
{
ns=navigator.appName=="Netscape";
if(ns)document.captureEvents(Event.MOUSEMOVE|Event.MOUSEDOWN);
document.onmousemove=DM;document.onmousedown=DM;
}function resizeMe(){
window.resizeTo(510,225);
}
//-->
</SCRIPT>+++++++++++++++
请大家看看。
如果你是设置了,那么错误信息是出不来的..
这种情况还是需要一步步调试....你先在你觉得有错误的地方输出断点看看..
rainxiang(楚王好细腰 后宫多饿死)
怎么设置断点,给具体指点一下行吗?
您说的也太夸张了吧。我都是我照书上辛苦常来的成果。
那你说怎么写呢。
<script>之间的代码就这样啦
vs支持vb吗?好像只支持C#吧。