⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coolsites.aspx

📁 商务网站全部程序.很有借鉴意义
💻 ASPX
📖 第 1 页 / 共 2 页
字号:
<%@ Page Language="VB" ContentType="text/html"%>
<%@ Register TagPrefix="gb" TagName="top" Src="lib/inctop.ascx" %>
<%@ Register TagPrefix="gb" TagName="footer" Src="lib/incfooter.ascx" %>
<%@ Import Namespace="system.data" %>
<%@ Import Namespace="system.data.oledb" %>
<!--#include file="config.inc"-->
<script runat="server">
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0; data source="+server.MapPath("data/sites.mdb"))

sub page_load(obj as object,e as eventargs)
 if not page.ispostback then
 sitename.text=webname
 
 coolsiteAll.text=executeSQl("coolsiteAll")
 linkAll.text=executeSQl("linkAll")
 linkNoPass.text=executeSQl("linkNoPass")
  
'最新加入
    join_number.text=newcoolsite
    join.datasource=filldata("select top " & newcoolsite & " * from coolsites order by cs_id desc")
	join.databind()
	conn.close()
'最新推荐
    commend_number.text=bestcoolsite
    commend.datasource=filldata("select top " & bestcoolsite & " * from coolsites where isbest =true order by cs_id desc")
	commend.databind()
	conn.close()
'分类
	sort.datasource=filldata("select * from cscat")
	sort.databind()
	conn.close
'点击Top
    topclick.text=topcoolsite
	top.datasource=filldata("select top " & topcoolsite & " * from coolsites  order by cs_count desc,cs_id desc")
    top.databind()
	conn.close
'链接分类
    link_sort.datasource=filldata("select * from flcat")
	link_sort.databind()
	conn.close
'链接申请分类	
    flcat_id.datasource=filldata("select flcat_id,flcat_name from flcat")
    flcat_id.databind()
    conn.close()
	
'启用链接分类
	if request("flcat_id")="" then
    link.datasource=filldata("SELECT flcat.flcat_id,fl_show, flcat.flcat_name, friendlink.fl_name, friendlink.fl_logo, friendlink.fl_url, friendlink.passed, friendlink.flcat_id, friendlink.fl_id, friendlink.fl_logo, friendlink.fl_url FROM flcat INNER JOIN friendlink ON flcat.flcat_id = friendlink.flcat_id WHERE (((flcat.flcat_id)=[friendlink].[flcat_id]) AND ((friendlink.passed)=True))")
   link.databind()
   conn.close
	else
	link.datasource=filldata("SELECT flcat.flcat_id, fl_show, flcat.flcat_name, friendlink.fl_name, friendlink.fl_logo, friendlink.fl_url, friendlink.passed, friendlink.flcat_id, friendlink.fl_id, friendlink.fl_logo, friendlink.fl_url FROM flcat INNER JOIN friendlink ON flcat.flcat_id = friendlink.flcat_id WHERE (((flcat.flcat_id)=[friendlink].[flcat_id]) AND (friendlink.passed)=True) and flcat.flcat_id=" & request("flcat_id"))
   link.databind()
   conn.close
   end if
end if
end sub

sub select_sort(obj as object,e as DataListCommandEventArgs)
    dim vindex as integer
	dim vkey as string
	try
	vindex=link.selectedindex
	vkey=link.datakeys(vindex).tostring
	response.Write(vkey)
    catch ex as exception
	response.Write(ex.message & ".." & vindex & "|" & vkey)
	end try
end sub

sub flcatAdd(obj as object,e as eventargs)
	  dim objcmd as new oledbcommand("friendlinkAdd",conn)
	  dim info as string
      objcmd.commandtype=commandtype.StoredProcedure

	  dim objParam as oledbParameter
	  
	  objParam=objcmd.Parameters.add("@flcat_id",oledbtype.integer)
	  objParam.direction=parameterdirection.input
	  objParam.value=flcat_id.value
	  
	  objParam=objcmd.Parameters.add("@fl_name",oledbtype.char)
	  objParam.direction=parameterdirection.input
	  objParam.value=fl_name.value
	  
	  objParam=objcmd.Parameters.add("@fl_logo",oledbtype.char)
	  objParam.direction=parameterdirection.input
	  objParam.value=fl_logo.value 
	  
	  objParam=objcmd.Parameters.add("@fl_url",oledbtype.char)
	  objParam.direction=parameterdirection.input
	  objParam.value=fl_url.value
	  
	  objParam=objcmd.Parameters.add("@fl_show",oledbtype.char)
	  objParam.direction=parameterdirection.input
	  objParam.value=fl_show.value
	  
	try
	   conn.open()
       objcmd.executenonquery
	   conn.close()
	   info="ok"
	catch ex as exception
	  info=ex.message
	finally
	   response.Redirect("savefl.aspx?info=" & info)
	end try   
end sub

function filldata(sql as string) as oledbdatareader
dim objcmd as new oledbcommand(sql,conn)
try
   objcmd.connection.open()
   return objcmd.executereader()
catch ex as exception
   response.Write(ex.message)
finally

end try
end function

function executeSQl(sql as string) as integer
		   dim intid as integer
		   dim objcmd as new oledbcommand(sql,conn)
		   objcmd.commandtype=commandtype.StoredProcedure

			try
			   conn.open()
			   intid=objcmd.executeScalar
               return intid
			catch ex as exception
			  return ex.message
			finally
			   conn.close()
			end try
end function


</script>
<gb:top runat="server"/>
<link href="site_css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<table width="960" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
  <tr> 
    <td height="10" colspan="3"></td>
  </tr>
  <tr>         
    <td align="center" valign="top" width="760"> 
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="98%" id="AutoNumber1">
        <tr>
          <td width="100%" style="border-style: none; border-width: medium">
        <div align="center"><img src="images/banner1.gif" width="469" height="150" />      </div></td>
        </tr>
        <tr>
          <td width="100%" style="border-style: none; border-width: medium">&nbsp;</td>
        </tr>
      </table>
      <div align="center">
        <center>
<form runat="server">
      <table width="98%" border="1" cellspacing="0" cellpadding="10" bgcolor="#293863" bordercolor="#808080" style="border-collapse: collapse">
        <tr> 
          <td bgcolor="#EFEFEF" align="center" class="chinese"><a href="showcs.aspx">
          <font color="#808080">当前共有 
		  <asp:label id="coolsiteAll" runat="server"/>个酷站,点击这里查看所有</font></a>
        </tr>
      </table>
        </center>
      </div>
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td height="6"></td>
        </tr>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td class="chinese" height="25"><font color="#808080"><img src="images/img.gif" width="18" height="13"> 最新加入的<asp:Label ID="join_number" runat="server"></asp:Label>个酷站</font></td>
        </tr>
      </table>
<asp:Repeater ID="join" runat="server">
<itemtemplate>
      <table width="98%" border="0" cellspacing="0" cellpadding="10" align="center">
        <tr> 
          <td width="37%" align="center"> 
            <table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="#D2D2D2">
              <tr> 
                <td bgcolor="#FFFFFF" align="center"><font color="#808080"><img src="<%# container.dataitem("cs_pic") %>" width="88" height="31" alt="<%# container.dataitem("cs_desc") %>"></font></td>
              </tr>
            </table>
          </td>
          <td width="63%" class="chinese"><font color="#808080"> 网站名称:<%# container.dataitem("cs_name") %><br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -