| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 378 人关注过本帖
标题:asp.net中投票的代码中为什么不能显示图片(我已经把图片和window放在同一文 ...
只看楼主 加入收藏
w566341966
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-5-24
收藏
 问题点数:0 回复次数:0 
asp.net中投票的代码中为什么不能显示图片(我已经把图片和window放在同一文件中)
<%@ Import Namespace="system" %>
<%@ Import Namespace=" %>
<script language="vbscript" runat="server" >
    Function readcountfile(ByVal countfile As String) As String
        If Not File.Exists(Server.MapPath(countfile)) Then
            Dim objwrite As StreamWriter = File.CreateText(Server.MapPath(countfile))
            objwrite.WriteLine("0")
            objwrite.Close()
        End If
        Dim objreader As New StreamReader(Server.MapPath(countfile))
        readcountfile = objreader.ReadLine()
        objreader.Close()
    End Function
    Sub writecountfile(ByVal countfile As String, ByVal cnt As Integer)
        Dim objwriter As New StreamWriter(Server.MapPath(countfile))
        objwriter.WriteLine(CStr(cnt))
        objwriter.Close()
    End Sub
    Sub page_load(ByVal sender As Object, ByVal e As EventArgs)
        Dim count1 As Integer = CInt(readcountfile("vote1.txt"))
        Dim count2 As Integer = CInt(readcountfile("vote2.txt"))
        dim count3 as integer = Cint(readcountfile("vote3.txt"))
        dim count4 as integer = Cint(readcountfile("vote4.txt"))
        If Session("visible") = "" Then
            Select Case Request("vote")
                Case "s1"
                    count1 += 1
                    writecountfile("vote1.txt", count1)
                Case "s2"
                    count2 += 1
                    writecountfile("vote2.txt", count2)
                case "s3"
                    count3+=1
                    writecountfile("vote3.txt",count3)
                case "s4"
                    count4+=1
                    writecountfile("vote4.txt", count4)
            End Select
            Session("visible") = "yes"
        End If
        selec1.Text = "图一得票:" & CStr(count1)
        selec2.Text = "图二得票:" & CStr(count2)
        selec3.Text = "图三得票: " & CStr(count3)
        selec4.Text = "图四得票: " & CStr(count4)
        
    End Sub
</script>
<html>
<body>
<center>
<table border=1 cellpadding=2 cellspacing=1>
   <tr><td><img scr="国产喷气式歼.jpg" width=80 height=80 /></td>
       <td><img scr="领袖们的珍贵瞬间.jpg" width=80 height=80 /></td>
       <td><img scr="土地革命.jip" width=80 height=80 /></td>
       <td><img scr="周恩来的出席.jpg" width=80 height=80 /></td>
   </tr>
   <tr><td><a href="window.aspx?vote=s1">给图一投票</a></td>
       <td><a href="window.aspx?vote=s2">给图二投票</a></td>
       <td><a href="window.aspx?vote=s3">给图三投票</a></td>
       <td><a href="window.aspx?vote=s4">给图四投票</a></td>
   </tr>
</table><br /><br /><p></p>
<asp:Label runat="server" ID="selec1"></asp:Label>
<asp:Label runat="server" ID="selec2"></asp:Label>
<asp:Label runat="server" id="selec3"></asp:Label>
<asp:Label runat="server" id="selec4"></asp:Label>
<asp:Label runat="server" ID="selec5"></asp:Label>
</center>
</body>
</html>

(链接无法找到!)
搜索更多相关主题的帖子: system 
2011-05-24 12:14
快速回复:asp.net中投票的代码中为什么不能显示图片(我已经把图片和window放在 ...
数据加载中...
 
   



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

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