| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 508 人关注过本帖
标题:生成ASP页面的问题
取消只看楼主 加入收藏
ali218
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2007-5-13
收藏
 问题点数:0 回复次数:1 
生成ASP页面的问题

我有一个音乐程序,我把它改成UTF-8编码方式,但是生成分类的时候他生成ANSI的形式,下面是代码
如何改才能生成UTF-8

<!--#include file="const.asp"-->
<!--#include file="error.ini"-->
<link href="Images/Admin_Style.Css" rel="stylesheet" type="text/css">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>生成歌曲排行</title>
</head>
<body>
<%
dim Ds,SkyIdStr,SkyIdEnd,SkyIdNow
Ds=timer()
SkyIdStr=clng(request("SkyIdStr"))
SkyIdEnd=clng(request("SkyIdEnd"))
SkyIdNow=request("SkyIdNow")

if request("type")="all" then
if skyidstr<1 or skyidend<1 or SkyIdStr>=SkyIdEnd then
'response.write "开始和结束ID不能为空,且结束ID必须大于开始ID"
response.write "<script language=vbscript>"& vbcrlf
response.write "aaa=msgbox(""开始和结束ID不能为空,且结束ID必须大于开始ID"",vbOKOnly)"& vbcrlf
response.write "</script>"
else
makeskysoft="yes"
end if
end if

if makeskysoft="yes" then
response.write"<b><font color=""#FF0000"">正在生成歌曲排行,请稍等......</font></b><BR><span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"
if request("p")<>"" then
p=cint(request("p"))
D=request("D")
else
p=1
D=Ds
end if
MaxPerPage=10

'mpage=3 '得到总页数
allshu=SkyIdEnd-SkyIdStr '得到总数

SkyIDNowPage=p*MaxPerPage+SkyIdStr
if SkyIDNowPage=>allshu+SkyIdStr then SkyIDNowPage=allshu+SkyIdStr

for id=(p-1)*MaxPerPage+SkyIdStr to SkyIDNowPage
i=i+1
call MakeHtml()
if i>=MaxPerPage then exit for
next

Sshu=MaxPerPage*p-MaxPerPage+SkyIdStr
Tshu=Sshu+i-1

if allshu+SkyIdStr<Sshu then
response.redirect "Make_topall.asp?type=ok&SkyIdStr="&request("SkyIdStr")&"&SkyIdEnd="&request("SkyIdEnd")&"&shu="&request("shu")&"&D="&d&"&p="&p+1&""
response.end
else
response.write"<meta http-equiv=""refresh"" content=""0;url='Make_topall.asp?type="&request("type")&"&SkyIdStr="&request("SkyIdStr")&"&SkyIdEnd="&request("SkyIdEnd")&"&shu="&Tshu&"&D="&D&"&p="&p+1&"'"">"
response.write"<B><BR>您选择的是从<font color=ff0000>"&request("SkyIdStr")&"</font>到<font color=ff0000>"&request("SkyIdEnd")&"</font>个,共<font color=ff0000>"&allshu&"</font>个页面"
response.write"<br>正在生成:第"&Sshu&"-"&Tshu&"个"
response.write"<br>已耗时"&FormatNumber((timer()-request("D")),2)&"秒</B>"
end if

Sub MakeHtml()
response.write"<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('Make_top.asp?id="&id&"',onDownloadDone)</script>"
end Sub
else

'shu=50

response.write"<b>批量生成歌曲排行"
if request("type")="ok" then
response.write"<br><br>操作成功:共生成<font color=""#FF0000"">"&request("SkyIdEnd")-request("SkyIdStr")&"</font>个页面<BR>总耗时<font color=""#FF0000"">"&FormatNumber((timer()-request("D")),2)&"</font>秒,完成时间在"&Now()&""
end if

response.write"<form name=pid method=""post"" action=""Make_topall.asp?type=all"">超始ID:<input size=8 name=""SkyIDStr"" value='1'> 终止ID:<input size=8 name=""SkyIDEnd"" value='12'><input name=""change"" class=""buttonface"" value=""确认"" type=""submit""></form>"
end if%>
</body>
</html>

搜索更多相关主题的帖子: ASP 页面 head body 
2007-07-07 22:43
ali218
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2007-5-13
收藏
得分:0 

它的Make_TOP.asp 文件代码如下好像有个FOS
[CODE]'################ 读标题 开始 ###############
htmtop_2=htmtop_2&"<TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=100% align=center bgColor=#ffffff borderColorLight=#bdd2d5 border=1>"
htmtop_2=htmtop_2&"<TBODY>"
htmtop_2=htmtop_2&"<script src=../Js/Js.js></script>"
htmtop_2=htmtop_2&"<FORM action=../playsong.asp name=form2 onsubmit='javascript:return ting2008 ();' target=ting2008>"
htmtop_2=htmtop_2&"<TR>"
htmtop_2=htmtop_2&"<TD height='22' align='center'>选</TD>"
htmtop_2=htmtop_2&"<TD>歌曲</TD>"
htmtop_2=htmtop_2&"<TD height='22' align='center'>选</TD>"
htmtop_2=htmtop_2&"<TD>歌曲</TD>"
htmtop_2=htmtop_2&"<TD height='22' align='center'>选</TD>"
htmtop_2=htmtop_2&"<TD>歌曲</TD>"
htmtop_2=htmtop_2&"<TD height='22' align='center'>选</TD>"
htmtop_2=htmtop_2&"<TD>歌曲</TD>"
htmtop_2=htmtop_2&"</TR>"
htmtop_2=htmtop_2&"<TR>"

dim i
i=0
page = request.querystring("id")
set rs=server.createobject("adodb.recordset")
sql="select * from ylmv_MusicList order by hits desc"
rs.open sql,conn,1,1
if rs.EOF then
response.write "<div align=center>未收录歌曲</div>"
else
rs.pagesize = "201"
if page = "" or page < "1" then
page = "1"
end if
if rs.pagecount > "0" then
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
if i > rs.pagesize then
exit do
end if
htmtop_2=htmtop_2&"<TD width='22' height='22'><input type='checkbox' name='id' value='"&rs("id")&"'></TD>"
htmtop_2=htmtop_2&"<TD width='168'><div align='justify'><a href='../MusicPlay/"&rs("Nclassid")&"/ylmv_"&rs("id")&".html' target='Ylmv'><FONT color=#000000>"&rs("MusicName")&"</font></a></TD>"
if i mod 4 =0 then
htmtop_2=htmtop_2&"<TR align=middle>"
end if
if i>=60 then exit do
rs.movenext
loop
end if
htmtop_2=htmtop_2&"</TR>"
htmtop_2=htmtop_2&"<TR>"
htmtop_2=htmtop_2&"<TD width='80%' align=center colSpan=12>"
htmtop_2=htmtop_2&"<input type='button' name='chkall' value='' onclick='CheckAll(this.form)' title='选择显示的所有歌曲' style=""width: 46px; height: 17px; background-image: url('../images/Icon_quanx.gif'); border-style: none; border-width: medium"">"
htmtop_2=htmtop_2&"&nbsp;&nbsp;&nbsp;&nbsp;"
htmtop_2=htmtop_2&"<input type='button' name='chkOthers' value='' onclick='CheckOthers(this.form)' title='反向选择歌曲' style=""width: 46px; height: 17px; background-image: url('../images/Icon_qux.gif'); border-style: none; border-width: medium"">"
htmtop_2=htmtop_2&"&nbsp;&nbsp;&nbsp;&nbsp;"
htmtop_2=htmtop_2&"<input type='submit' name='B1' value='' title='请先选择你想听的歌曲后再点击播放' style=""width: 75px; height: 17px; background-image: url('../images/Icon_playall.gif'); border-style: none; border-width: medium"">"
htmtop_2=htmtop_2&"</form>"
htmtop_2=htmtop_2&"</TABLE>"
rs.close
set rs=nothing
conn.close
set conn=nothing
pencat=replace(pencat,"htmtop_2",htmtop_2)
htmtop_1="&nbsp;<a href='../'><font color=#000000>"&homes&"</font></a> <font color=#000000>>></font> <a href='../Music.html'><font color=#000000>音乐频道</font></a> <font color=#000000>>></font> <font color=#000000> 歌曲排行</font>"
pencat=replace(pencat,"htmtop_1",htmtop_1)
'################ 读结束 ###############
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(FILENAME))
fout.Write pencat
fout.close
'************** 生成结束 **************[/CODE]


[此贴子已经被作者于2007-7-8 13:01:46编辑过]


2007-07-08 13:01
快速回复:生成ASP页面的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016678 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved