zoukankan      html  css  js  c++  java
  • .net image counter

    真实奇怪了啊,为什么我的语句执行有错误呢?

    错误的原因是,当counter>10000的时候,只能显示前4位。

    请问怎样解决这个问题……………………

    源代码如下:

    <%@ page language="VB" Debug="true" %>
    <%@ Import Namespace="System.IO"%>
    <script language="VB" runat="server">
        
    Function GetFileName() As String
            
    Dim FullPath As String
            
    Dim Position As Integer
            FullPath
    =Request.ServerVariables("PATH_TRANSLATED")
            Position
    =InstrRev(FullPath,".")
            GetFileName
    =Mid(Fullpath,1,Position)&"cnt"
        End Function

        
        
    sub Page_Load(sender As Object, e As EventArgs)
            
    if not Page.IsPostBack() then
                
    Dim i As Integer
                
    Dim Img As Image
                
    Dim Count As Integer
                
    Dim Graph As string
                
    Dim mystream As FileStream
                
    Dim pathname,datastr As string
                
    Dim strreadobj As StreamReader
                
    Dim strwriteobj As StreamWriter
                
                pathname
    =GetFileName()
                mystream 
    =New FileStream(pathname,FileMode.OpenOrCreate,FileAccess.Read)
                strreadobj
    =New StreamReader(mystream)
                datastr
    =strreadobj.ReadLine()
                strreadobj.Close()
                
                Count
    =CInt(datastr)+1
                
                
                
    for i=1 to len(Count)
                    Img
    =New Image()
                    Graph
    =Mid(Count,i,1
                    
    if Graph="" then
                        Img.ImageUrl
    ="Images/0.gif"
                    Else    
                        Img.ImageUrl
    ="Images/" & Graph & ".gif"
                        MyDiv.Controls.Add(Img)
                    
    end If
                
    next    
                
                mystream
    =New FileStream(pathname,FileMode.Open,FileAccess.Write)
                strwriteobj
    =New StreamWriter(mystream)
                strwriteobj.
    WriteLine(Count)
                strwriteobj.Close()
            
    end if
        
    End sub
            
                    
    </script>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>Text Counter</title>
    </head>
    <body>
    <form runat="server">
        访问人数:
    <div id="MyDiv" runat="server"></div>
    </form>
    </body>
    </html>
  • 相关阅读:
    [转载]Quartus ii 一些Warning/Eeror分析与解决
    [转载]MAC、IP头、TCP头、UDP头帧格式、详解
    [转载]关于晶振ppm
    20140919-FPGA-有效观察设计中的差分信号
    [转载]转一篇Systemverilog的一个牛人总结
    [转载]ISE中COE与MIF文件的联系与区别
    linux系统性能监控--I/O利用率
    linux系统性能监控--内存利用率
    linux系统性能监控--CPU利用率
    在linux系统中I/O 调度的选择
  • 原文地址:https://www.cnblogs.com/yang_sy/p/39880.html
Copyright © 2011-2022 走看看