<!--#include file=gdibn.inc-->
<%
Server.ScriptTimeOut=120
dim id
on error resume next 
	id=request("id")
	if id="" then
	id=01
	end if
	typeid=request("typeid")
	page=request("page")
	if page="" then
	page=1
	end if
	if typeid<>"" then
	url="http://www.skycn.net/sort/sort2"&id&typeid&"00_indate_DESC_"&page&".html"
	else
	url="http://www.skycn.net/sort/sort"&id&"0000_indate_DESC_"&page&".html"
	end if
	set myCache=new cache
	myCache.name=id&typeid&page
	if myCache.valid then
	sortcode = myCache.value
	else
	sortcode=getHTTPPage(url)
	myCache.add sortcode,dateadd("d",1,now)
	end if 	
	if err.number=0 then
	start=Instr(sortcode,"</td></tr><tr><td align='center'>")+33
	over=Instr(sortcode,"<br></td></tr>")
	typecode=mid(sortcode,start,over-start)
	typearr=split(typecode,"<A href=")
	for i=1 to ubound(typearr)
	if i<10 then
	typelistcode=typelistcode&"<img src=images/-.gif border=0 align=absmiddle>&nbsp;<A href=sort.asp?id="&id&"&typeid=0"&i&right(typearr(i),len(typearr(i))-32)
	else
	typelistcode=typelistcode&"<img src=images/-.gif border=0 align=absmiddle>&nbsp;<A href=sort.asp?id="&id&"&typeid="&i&right(typearr(i),len(typearr(i))-32)
	end if
	next
	start=Instr(sortcode,"<tr><td align='left'>")+21
	over=Instr(sortcode,"<script language=javascript src=../js/fl_ad3.js></script>")
	topcode=mid(sortcode,start,over-start)
	topcode=replace(topcode,"../soft/","soft.asp?id=")
	topcode=replace(topcode,".html","")
	start=Instr(sortcode,"合计")+2
	over=Instr(sortcode,"条软件")
	totalnum=mid(sortcode,start,over-start)
	start=Instr(sortcode,"| 共")+3
	over=Instr(sortcode,"页 |")
	totalpage=mid(sortcode,start,over-start)
	softlistarr=split(sortcode,"<td align=left width=355>")
	for i=1 to ubound(softlistarr)
	over=Instr(softlistarr(i),"<tr><td colspan=4>")-1
	softlistcode=mid(softlistarr(i),1,over)
	softlistcode=replace(softlistcode,"../soft/","soft.asp?id=")
	softlistcode=replace(softlistcode,".html","")
	softcode=softcode&"<tr bgcolor='#FFFFFF'><td width='420'>"&softlistcode
	next
	Erase softlistarr
	else 
		wscript.echo err.description 
	end if
	%>
<HTML>
<HEAD>
<TITLE>软件下载 - 延安生活信息网 - <%
select case id
case 01
response.write "网络软件"
case 02
response.write "系统工具"
case 03
response.write "应用软件"
case 04
response.write "联络聊天"
case 05
response.write "图形图像"
case 06
response.write "多媒体类"
case 07
response.write "行业软件"
case 08
response.write "游戏娱乐"
case 09
response.write "编程开发"
case 10
response.write "安全相关"
case 11
response.write "教育教学"
case else
response.redirect "index.asp"
end select
%></TITLE>
<!--#include file="head.asp"-->
<TABLE width=776 border=0 align="center" cellPadding=3 cellSpacing=0 
borderColorLight=#000000 borderColorDark=#ffffff>
  <TBODY>
    <TR align=middle bgColor=#e6ebf0>
      <TD height="100" align="center" vAlign=top bgcolor="#e6ebf0"><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR>
              <TD height="25">&nbsp;您现在的位置是：下载特区-&gt;
                  <%
select case id
case 01
response.write "<a href=sort.asp?id=01>网络软件</a>"
case 02
response.write "<a href=sort.asp?id=02>系统工具</a>"
case 03
response.write "<a href=sort.asp?id=03>应用软件</a>"
case 04
response.write "<a href=sort.asp?id=04>联络聊天</a>"
case 05
response.write "<a href=sort.asp?id=05>图形图像</a>"
case 06
response.write "<a href=sort.asp?id=06>多媒体类</a>"
case 07
response.write "<a href=sort.asp?id=07>行业软件</a>"
case 08
response.write "<a href=sort.asp?id=08>游戏娱乐</a>"
case 09
response.write "<a href=sort.asp?id=09>编程开发</a>"
case 10
response.write "<a href=sort.asp?id=10>安全相关</a>"
case 11
response.write "<a href=sort.asp?id=11>教育教学</a>"
case else
response.redirect "index.asp"
end select
%>
                -&gt; 软件列表 </TD>
            </TR>
          </TBODY>
        </TABLE>
          <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="214">
            <tr valign="top">
              <td width="205" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="28" background="images/toolbar_bg.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0" height="22">
                        <tr>
                          <td width="49"><div align="center"><img src="images/icon.gif" width="11" height="14"></div></td>
                          <td width="150"><font color="#FFFFFF"><b><font color="#FF0000">软件搜索</font></b></font></td>
                        </tr>
                    </table></td>
                  </tr>
                </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="92">
                    <tr>
                      <td><table width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
                          <form name="form1" method="post" action="search.asp">
                            <tr>
                              <td width="210"><input type="text" name="ss_name" size="25" maxlength="40">
                                  <br>
                                  <br>
                                  <select name="sor" >
                                    <option value="00" >全部软件</option>
                                    <option value="01">国产软件</option>
                                    <option value="02">国外软件</option>
                                    <option value="03">汉化补丁</option>
                                    <option value="wz" >软件资讯</option>
                                  </select>
                                  <input type="submit" name="Submit2" value=" 搜 索 ">
                              </td>
                            </tr>
                          </FORM>
                      </table></td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="28" background="images/toolbar_bg.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0" height="22">
                          <tr>
                            <td width="49"><div align="center"><img src="images/icon.gif" width="11" height="14"></div></td>
                            <td width="150"><font color="#FFFFFF"><b><font color="#FF0000">本栏分类</font></b></font></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="203"><table border="0" align="center" height="25">
                          <tr>
                            <td><%=typelistcode%></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="28" background="images/toolbar_bg.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0" height="22">
                          <tr>
                            <td width="49"><div align="center"><img src="images/icon.gif" width="11" height="14"></div></td>
                            <td width="150"><font color="#FFFFFF"><b><font color="#FF0000">本类下载排行</font></b></font></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="205"><table width="96%" border="0" cellspacing="2" cellpadding="0" align="center">
                          <tr>
                            <td width="197"><%=topcode%></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                </table></td>
              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="1" bgcolor="#999999"></td>
                    <td valign="top" bgcolor="#FFFFFF"><table width="566" border="0" cellpadding="0" cellspacing="1" style="word-break:break-all" height="41" bgcolor="#CCCCCC">

                        <tr>
                          <td width="357" height="25" align="center" bgcolor="#FFFFFF">软 件 名 称 </td>
                          <td width="69" align="center" bgcolor="#FFFFFF">更新日期 </td>
                          <td width="59" align="center" bgcolor="#FFFFFF"> 人气</td>
                          <td width="60" align="center" bgcolor="#FFFFFF"><div align="center">软件大小</div></td>
                        </tr>
                      </table>
                        <table width="100%" border=0 cellpadding=4 cellspacing=1 bgcolor="#CCCCCC" id="TbSoftList">
                          <%=softcode%>
                          <tr bgcolor="#F5F5F5">
                            <td colspan="4" align="center" bgcolor="#F5F5F5"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td> 合计<font color="red"><b><%=totalnum%></b></font>个 |　
                                      <%
if page<=1 then
page=1
if typeid<>"" then
response.write "首页 上一页 <a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page+1&"> 下一页</a> <a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&totalpage&"&>尾页</a>"
else
response.write "首页 上一页 <a href=sort.asp?id="&id&"&page="&page+1&"> 下一页</a> <a href=sort.asp?id="&id&"&page="&totalpage&">尾页</a>"
end if
elseif page >=totalpage then
if typeid<>"" then
response.write "<a href=sort.asp?id="&id&"&typeid="&typeid&"&page=1>首页</a> <a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page-1&">上一页</a>  <a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page+1&"> 下一页</a> <a href=sort.asp?id="&id&"&page="&totalpage&">尾页</a>"
else
response.write "<a href=sort.asp?id="&id&"&page=1>首页 </a> <a href=sort.asp?id="&id&"&page="&page-1&">上一页</a> <a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page+1&">下一页</a> <a href=sort.asp?id="&id&"&page="&totalpage&">尾页</a>"
end if
elseif page>1 and page<totalpage then
if typeid<>"" then
response.write "<a href=sort.asp?id="&id&"&typeid="&typeid&"&page=1>首页</a><a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page-1&">上一页</a><a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&page+1&">下一页</a><a href=sort.asp?id="&id&"&typeid="&typeid&"&page="&totalpage&">尾页</a>"
else
response.write "<a href=sort.asp?id="&id&"&page=1>首页 </a> <a href=sort.asp?id="&id&"&page="&page-1&">上一页</a> <a href=sort.asp?id="&id&"&page="&page+1&"> 下一页</a> <a href=sort.asp?id="&id&"&page="&totalpage&">尾页</a>"
end if
end if
%>
                                　页次：<strong><font color=red><%=page%></font>/<%=totalpage%></strong>页 <b>20</b>个/页</td>
                                  <form action="" method=post onChange="submit()">
                                    <td>Go:
                                        <select name="select2" onChange='javascript:window.open(this.options[this.selectedIndex].value,"_top")'>
                                          <%
if typeid<>"" then
for i=1 to totalpage
if request("page")=i then
response.write "<option value='sort.asp?id="&id&"&typeid="&typeid&"&page="&i&"' selected>第"&i&"页</option>"
else
response.write "<option value='sort.asp?id="&id&"&typeid="&typeid&"&page="&i&"'>第"&i&"页</option>"
end if
next
else
for i=1 to totalpage
if request("page")=i then
response.write "<option value='sort.asp?id="&id&"&page="&i&"' selected>第"&i&"页</option>"
else
response.write "<option value='sort.asp?id="&id&"&page="&i&"'>第"&i&"页</option>"
end if
next
end if
%>
                                        </select>
                                    </td>
                                  </form>
                                </tr>
                            </table></td>
                          </tr>
                      </table></td>
                  </tr>
              </table></td>
            </tr>
        </table></TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="foot.asp"-->
</BODY>
</HTML>
<%
	  function getHTTPPage(url) 
		on error resume next 
		dim http 
		set http=Server.createobject("Microsoft.XMLHTTP") 
		Http.open "GET",url,false 
		Http.send() 
		if Http.readystate<>4 then
			exit function 
		end if 
		getHTTPPage=bytes2BSTR(Http.responseBody) 
		set http=nothing
		if err.number<>0 then err.Clear  
	end function 
	Function bytes2BSTR(vIn) 
		dim strReturn 
		dim i1,ThisCharCode,NextCharCode 
		strReturn = "" 
		For i1 = 1 To LenB(vIn) 
			ThisCharCode = AscB(MidB(vIn,i1,1)) 
			If ThisCharCode < &H80 Then 
				strReturn = strReturn & Chr(ThisCharCode) 
			Else 
				NextCharCode = AscB(MidB(vIn,i1+1,1)) 
				strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) 
				i1 = i1 + 1 
			End If 
		Next 
		bytes2BSTR = strReturn 
	End Function 
%>
