• 请不要在回答技术问题时复制粘贴 AI 生成的内容
older
V2EX  ›  程序员

看看以前的同事写的代码

  •  
  •   older · Jul 5, 2013 · 7070 views
    This topic created in 4868 days ago, the information mentioned may be changed or developed.
    <!--#include file="header.asp" -->
    <div id="content">
    <MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 direction=up width=1 height=1 delay="1">
    <div class="content-top"><img src="images/content-top.jpg" width="938" height="4" /></div>
    <div class="content-zhong">
    <div class="con-left">
    <p class="font">About us</p>
    <p class="neirong"><%=left(rs4("eabout"),600)%>...</p>
    <p class="font">Products Categories</p>
    <div style="margin-top:10px; padding-left:20px;">
    <% set rs=server.CreateObject("adodb.recordset")
    sql="select * from product where audit=1 order by id desc"
    rs.open sql,conn,1,3%>
    <%
    do while not rs.eof
    %>
    <p style="width:106px; float:left; padding:5px; line-height:34px; height:130px; background:url(images/cp-bg.jpg) no-repeat;">
    <span><a href="products.asp?sort_id=<%=rs("sort_id")%>"><img src="../pic/<%=rs("pic")%>" width="96" height="88" border="0"/></a></span><br />
    <a style="color:#000;" href="products.asp?sort_id=<%=rs("sort_id")%>"><%=rs("ecpmc")%></a></p>
    <%
    rs.movenext
    loop
    rs.close
    %>
    </div>

    </div>
    <div class="con-right">
    <!--#include file="right.asp" -->
    </div>

    <div class="content-buttom"><img src="images/content-buttom.jpg" width="938" height="4" /></div>
    </div>
    <!--#include file="footer.asp" -->
    </body>
    </html>
    48 replies  •  1970-01-01 08:00:00 +08:00
    d0a1ccec
    d0a1ccec
    Jul 5, 2013
    1
    我和我的小伙伴们都惊呆了.asp
    66beta
    66beta
    Jul 5, 2013
    2
    玩asp的就这水平了,当年我也这样,~~呵呵呵呵呵
    thinkif
    thinkif
    Jul 5, 2013
    3
    这得看是多久以前。。。
    refresh
    refresh
    Jul 5, 2013
    4
    asp居然还在人间
    yibin001
    yibin001
    Jul 5, 2013
    5
    我和我的小伙伴们都惊呆了
    Ricepig
    Ricepig
    Jul 5, 2013
    6
    写的不错,快速直接满足需求,哈哈
    solo7net
    solo7net
    Jul 5, 2013
    7
    asp亮了
    older
    older
    OP
    Jul 5, 2013
    8
    很难想象他当时是在什么状态写下这样的代码
    Feobe
    Feobe
    Jul 5, 2013
    9
    这是几年前的代码了?
    四五年前的话,勉强情有可原。
    6mN361AJx04in471
    6mN361AJx04in471
    Jul 5, 2013
    10
    当年写的ASP,不都是差不多一样嘛。
    timothyye
    timothyye
    Jul 5, 2013
    11
    ASP.... 古董级别的代码了
    ninjai
    ninjai
    Jul 5, 2013
    12
    没看出来多大问题,asp就这样了
    fangzhzh
    fangzhzh
    Jul 5, 2013
    13
    我是web外行, 但是:
    1 我在网页里看到了select *, 难道不是 写select* 都要拖出去TJJTDS吗?

    2 逐条操作的代码, 这页面, 估计sql server经不起上千的访问
    CoX
    CoX
    Jul 5, 2013
    14
    看到这个,忍不住贴下我们公司官方网站的一个文件,忍不住想给重写了

    http://gist.github.com/bjjay/41bfd1aa8b3a77f7b345.js
    yibin001
    yibin001
    Jul 5, 2013
    17
    yibin001
    yibin001
    Jul 5, 2013
    19
    呃。。本想帮一下楼上。。。结果发现我也不会。。
    @CoX
    CoX
    CoX
    Jul 5, 2013
    20
    又不会帖gist的代码了,不折腾了
    CoX
    CoX
    Jul 5, 2013
    21
    @yibin001 呵呵,很久以前帖成功过,现在又不记得了
    Hyperion
    Hyperion
    Jul 5, 2013
    23
    看到"MARQUEE", 我就颤抖了... 这是啥年代的标签了...
    yibin001
    yibin001
    Jul 5, 2013
    24
    @CoX
    是不是因为这个gist是私有的原因?我看文件名是一个hash值啊
    refresh
    refresh
    Jul 5, 2013 via iPad
    25
    @CoX 牛逼的代码
    binjoo
    binjoo
    Jul 5, 2013
    26
    凑合着用吧。
    Sunyanzi
    Sunyanzi
    Jul 5, 2013
    27
    顶楼的 ASP 没有任何问题 ..? 换言之 ... 如果不这么写还能怎么写 ..?

    那段 js 虽然难看点 ... 但感觉问题也不大 ...

    能用 ... 效率不低 ... 且重构复杂 ... 只是无法维护罢了 ...
    manoon
    manoon
    Jul 5, 2013
    28
    很有我的风格,一直这样写,从未被超越
    现在不知道,反正对于ASP来说,以前。
    很少会有MVC相关的概念,也没有一些简单易用类似于SMARTY之类的框架。
    workaholic
    workaholic
    Jul 5, 2013
    29
    我和我的小伙伴们都惊呆了
    CoX
    CoX
    Jul 5, 2013
    30
    @yibin001 不是私有gist,可以直接查看的啊

    @refresh 我估计我们公司这个官网是找某个个人做的,具体做了多久不知道了。我贴的那堆代码就是为了实现在一个表里做个简单查询。另外,整个数据库的表设计的是一塌糊涂。公司想让改版,我就建议重写。
    sarices
    sarices
    Jul 5, 2013
    31
    asp不是这样写的,我当年是用jscript写asp,然后用xsl做模板 ,封装好类库,尽量用MVC结构实现,这样后面接手的根据文档能很方便修改。
    raptor
    raptor
    Jul 5, 2013
    32
    不错了。我以前同事写过用拼音首字母缩写做变量名的…比如:时间是SJ…
    icoder
    icoder
    Jul 5, 2013
    33
    代码咋样无所谓的,运行没毛病就行了
    hellmash
    hellmash
    Jul 5, 2013
    34
    看到这段代码就想起00年用asp做基于exchange5.5的公文流转,那时候多羡慕那些基于LotusNotes/Domino做的公文流转
    VYSE
    VYSE
    Jul 5, 2013
    35
    asp页面这样再正常不过,嘲笑早期开发者的工作想想以后会不会有人嘲笑现在人的工作
    qingfeng
    qingfeng
    Jul 5, 2013
    36
    quick and dirty风格,我喜欢!
    013231
    013231
    Jul 5, 2013
    37
    @CoX V2EX只能貼Public Gist, 你那個是Secret Gist. 創建一個Gist時底下有兩個按鈕可選的.
    haichong520
    haichong520
    Jul 5, 2013
    38
    Beautiful Code
    holy_sin
    holy_sin
    Jul 5, 2013
    39
    好恶心啊
    wtser
    wtser
    Jul 5, 2013
    40
    强迫症来了,想重构的冲动!!!
    infong
    infong
    Jul 5, 2013
    41
    好喜欢这样的风格。XD。
    Kvm
    Kvm
    Jul 6, 2013
    42
    10年前php也基本这个样吧
    ASP的MVC概念还没起来就已经被抛弃了。。。
    看到过ASP写得很好的,但是局限于ASP本身的问题最后也随波逐流了。。。。。
    Perry
    Perry
    Jul 6, 2013 via iPhone
    43
    Perry
    Perry
    Jul 6, 2013 via iPhone
    44
    daoluan
    daoluan
    Jul 6, 2013
    45
    恩,小伙伴们都惊呆了。
    46fo
    46fo
    Jul 6, 2013
    46
    楼主敢 秀你自己的代码么??? 再怎么完美也会有人吐槽的
    older
    older
    OP
    Jul 6, 2013
    47
    @xdeng
    <!--#INCLUDE FILE="inc/conn.asp"-->
    <!--#INCLUDE FILE="inc/sub.asp"-->
    <!--#INCLUDE FILE="inc/companyData.asp"-->
    <!--#INCLUDE FILE="inc/Xdownpage.asp"-->
    <%
    language = "cn"

    productsPartID = request("ProductsPartID")
    dim strSql , strWhere, strTitle
    strSql = " SELECT Productsid,pics,pic,ProductsText,ProductsName,ProductsPartID FROM RF_Products WHERE DisplayLevel > 0 AND productsName <> '' "

    if productsPartID <> "" then ' 类别ID是否为空
    ProductsPartID = clng(productsPartID)
    StrSqlPart="select ProductsPartName from RF_ProductsPart where ProductsPartID= " & ProductsPartID
    Set rsPart=conn.execute(StrSqlPart)
    strTitle = rsPart("ProductsPartName")
    else
    ProductsPartID = 0
    strTitle = "产品展示"
    end if
    if request("q") <> "" then '搜索关键字不空
    strWhere=" AND ProductsName like '%"&request("q")&"%' OR ProductsText like '%"&request("q")&"%'"
    end if
    if ProductsPartID <> 0 then strWhere = strWhere &" AND ProductsPartID ="&ProductsPartID
    strSql = strSql & strWhere & " order by DisplayLevel DESC , ProductsName ASC"
    'Response.Write(strSql)

    if sm ="" then
    sm=0
    else
    sm=sm-1
    end if

    %>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title><%=strTitle%>--<%=WebTitle%></title>
    <META name="description" content="<%=Description%>">
    <meta name="keywords" content="<%=Keywords%>">
    <link rel="stylesheet" type="text/css" href="css/_main.css"/>
    <!--二级菜单-->
    <script type="text/javascript" src="js/subMenu.js"></script>
    </head>

    <body>
    <!--#INCLUDE FILE="inc_header.asp"-->
    <div class="wrap">
    <div class="side">
    <ul class="sideMenu">
    <%=productClassNavBig (language,productsPartID) %>
    </ul>
    </div>
    <div class="content">
    <div class="content-head"><a href="index.asp">首页</a><span>>></span><a href="productIndex.asp">产品中心</a><span>>></span><%=strTitle%></div>

    <ul class="productList">
    <%
    Set mypage=new xdownpage '创建对象
    mypage.getconn=conn '得到数据库连接

    mypage.getsql=strSql
    mypage.pagesize=15 '设置每一页的记录条数据为5条
    set rs=mypage.getrs() '返回Recordset

    for i=1 to mypage.pagesize '接下来的操作就和操作一个普通Recordset对象一样操作
    if not rs.eof then '这个标记是为了防止最后一页的溢出
    response.write"<li><a href=""ProductShow.asp?ProductsPartID="&rs("ProductsPartID")&"&sm="&sm+1&"&ProductsID="&rs("Productsid")&""" target=""_blank"" ><img src=""pics/"&rs("pics")&""" alt="""&rs("ProductsName")&""" /></a><dl><dt><a href=""ProductShow.asp?ProductsPartID="&rs("ProductsPartID")&"&sm="&sm&"&ProductsID="&rs("Productsid")&""" target=""_blank"" >"&rs("ProductsName")&"</a></dt></dl></li>"& chr(10)

    rs.movenext
    else
    exit for
    end if
    next
    %>
    </ul>
    <div class="cb pl20">
    <%
    mypage.showpage()
    %>
    </div>

    </div>
    </div>
    <!--#INCLUDE FILE="inc_footer.asp"-->
    </body>
    </html>
    46fo
    46fo
    Jul 6, 2013
    48
    @older 其实我我看不懂。。。。^o^
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1715 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 75ms · UTC 23:49 · PVG 07:49 · LAX 15:49 · JFK 18:49
    ♥ Do have faith in what you're doing.