将asp代码转换为java/jsp(可带js)
<!--#includefile="conn.asp"--><linkhref="/css/index.css"rel="stylesheet"type="text/cs...
<!--#include file="conn.asp" -->
<link href="/css/index.css" rel="stylesheet" type="text/css">
<script language="javascript" src="/script/function.js"></script>
<%
n = request.QueryString("n")
if n = "" then
n = 0
end if
l = request.QueryString("l")
if l = "" then
l = 1
end if
guize = request.QueryString("guize")
if guize = "请生成整个站点999" then
g2 = " where id > " & n
else
g2 = " where id > " & n & " and " & guize & " "
end if
if guize = "" or guize = "请生成整个站点" then
%>
<form action="?" method="get">
<input name="guize" type="text" value="请生成整个站点" size="100" maxlength="700">
<input name="提交" type="submit" value="开始生成">
</form>
<p>刷新1级栏目:c1=* (*代表1级栏目数字id号)</p>
<p>刷新2级栏目:c2=* (*代表2级栏目数字id号)</p>
<p>刷新3级栏目:c3=* (*代表3级栏目数字id号)</p>
<p>刷新4级栏目:c4=* (*代表4级栏目数字id号)</p>
<p>刷新5级栏目:c5=* (*代表5级栏目数字id号)</p>
<p>刷新某一区间信息: id>=n1 and id<=n2 (n1代表开始信息id号,n2代表结束id号)</p>
<p>刷新某一id号后的信息: id>=n1 (n1代表开始信息id号)</p>
<p>刷新某一id号前的信息: id<=n1 (n1代表结束信息id号)</p>
<p>刷新失败信息: id in(select id from news_false)</p>
<p>
<%
conn.close()
set conn = nothing
response.end()
else
ac = request("ac")
if ac = "" then
ac = conn.execute("select count(id) from news_content " & g2)(0)
end if
end if
n = clng(n)
set rs = server.CreateObject("adodb.recordset")
sqlstr = "select top 1 id,title,filepath from news_content " & g2 & " order by id asc"
rs.open sqlstr,conn,1,1
response.write "共" & ac & "信息 当前" & n & "<br>"
if rs.eof then
rs.close()
set rs = nothing
conn.close()
set conn = nothing
response.write "更新完成"
response.end()
end if
title = rs("title")
id = rs.fields("id")
title = "<a target=_blank href=http://" & hostheader & rs("filepath") & ">" & rs("title") & "</a>"
rs.close()
set rs = nothing
conn.close()
set conn = nothing
%>
<script language="javascript">
<!--
var id = <%= id %>;
var filepath = '/news/make.asp?id=' + id + '&' + Math.random();
sxzt = gethttppage(filepath);
sxzt = sxzt.replace(/\/html\/.*?(shtml|asp|html)/ig,0);
if(sxzt==0){
document.write('当前第<% = l %> 条<br>');
document.write('<%= title %> 生成成功');
}
else{
alert(sxzt);
alert('<%= title %> 失败,' + sxzt);
}
function clock()
{
i=i-1
if(i>0)setTimeout("clock();",300);
else location.replace('?ac=<%= ac %>&l=<%= l + 1 %>&n=<%= id %>&guize=<%= guize %>');
}
var i=2;
clock();
//-->
</script>
</p> 展开
<link href="/css/index.css" rel="stylesheet" type="text/css">
<script language="javascript" src="/script/function.js"></script>
<%
n = request.QueryString("n")
if n = "" then
n = 0
end if
l = request.QueryString("l")
if l = "" then
l = 1
end if
guize = request.QueryString("guize")
if guize = "请生成整个站点999" then
g2 = " where id > " & n
else
g2 = " where id > " & n & " and " & guize & " "
end if
if guize = "" or guize = "请生成整个站点" then
%>
<form action="?" method="get">
<input name="guize" type="text" value="请生成整个站点" size="100" maxlength="700">
<input name="提交" type="submit" value="开始生成">
</form>
<p>刷新1级栏目:c1=* (*代表1级栏目数字id号)</p>
<p>刷新2级栏目:c2=* (*代表2级栏目数字id号)</p>
<p>刷新3级栏目:c3=* (*代表3级栏目数字id号)</p>
<p>刷新4级栏目:c4=* (*代表4级栏目数字id号)</p>
<p>刷新5级栏目:c5=* (*代表5级栏目数字id号)</p>
<p>刷新某一区间信息: id>=n1 and id<=n2 (n1代表开始信息id号,n2代表结束id号)</p>
<p>刷新某一id号后的信息: id>=n1 (n1代表开始信息id号)</p>
<p>刷新某一id号前的信息: id<=n1 (n1代表结束信息id号)</p>
<p>刷新失败信息: id in(select id from news_false)</p>
<p>
<%
conn.close()
set conn = nothing
response.end()
else
ac = request("ac")
if ac = "" then
ac = conn.execute("select count(id) from news_content " & g2)(0)
end if
end if
n = clng(n)
set rs = server.CreateObject("adodb.recordset")
sqlstr = "select top 1 id,title,filepath from news_content " & g2 & " order by id asc"
rs.open sqlstr,conn,1,1
response.write "共" & ac & "信息 当前" & n & "<br>"
if rs.eof then
rs.close()
set rs = nothing
conn.close()
set conn = nothing
response.write "更新完成"
response.end()
end if
title = rs("title")
id = rs.fields("id")
title = "<a target=_blank href=http://" & hostheader & rs("filepath") & ">" & rs("title") & "</a>"
rs.close()
set rs = nothing
conn.close()
set conn = nothing
%>
<script language="javascript">
<!--
var id = <%= id %>;
var filepath = '/news/make.asp?id=' + id + '&' + Math.random();
sxzt = gethttppage(filepath);
sxzt = sxzt.replace(/\/html\/.*?(shtml|asp|html)/ig,0);
if(sxzt==0){
document.write('当前第<% = l %> 条<br>');
document.write('<%= title %> 生成成功');
}
else{
alert(sxzt);
alert('<%= title %> 失败,' + sxzt);
}
function clock()
{
i=i-1
if(i>0)setTimeout("clock();",300);
else location.replace('?ac=<%= ac %>&l=<%= l + 1 %>&n=<%= id %>&guize=<%= guize %>');
}
var i=2;
clock();
//-->
</script>
</p> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询