.net image counter

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

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

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

源代码如下:

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

InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Sub Page_Load()sub Page_Load(sender As Object, e As EventArgs)
InBlock.gif        
if not Page.IsPostBack() then
InBlock.gif            
Dim i As Integer
InBlock.gif            
Dim Img As Image
InBlock.gif            
Dim Count As Integer
InBlock.gif            
Dim Graph As string
InBlock.gif            
Dim mystream As FileStream
InBlock.gif            
Dim pathname,datastr As string
InBlock.gif            
Dim strreadobj As StreamReader
InBlock.gif            
Dim strwriteobj As StreamWriter
InBlock.gif            
InBlock.gif            pathname
=GetFileName()
InBlock.gif            mystream 
=New FileStream(pathname,FileMode.OpenOrCreate,FileAccess.Read)
InBlock.gif            strreadobj
=New StreamReader(mystream)
InBlock.gif            datastr
=strreadobj.ReadLine()
InBlock.gif            strreadobj.Close()
InBlock.gif            
InBlock.gif            Count
=CInt(datastr)+1
InBlock.gif            
InBlock.gif            
InBlock.gif            
for i=1 to len(Count)
InBlock.gif                Img
=New Image()
InBlock.gif                Graph
=Mid(Count,i,1
InBlock.gif                
if Graph="" then
InBlock.gif                    Img.ImageUrl
="Images/0.gif"
InBlock.gif
                Else    
InBlock.gif                    Img.ImageUrl
="Images/" & Graph & ".gif"
InBlock.gif
                    MyDiv.Controls.Add(Img)
InBlock.gif                
end If
InBlock.gif            
next    
InBlock.gif            
InBlock.gif            mystream
=New FileStream(pathname,FileMode.Open,FileAccess.Write)
InBlock.gif            strwriteobj
=New StreamWriter(mystream)
InBlock.gif            strwriteobj.
WriteLine(Count)
InBlock.gif            strwriteobj.Close()
InBlock.gif        
end if
ExpandedSubBlockEnd.gif    
End sub
        
InBlock.gif                
InBlock.gif
</script>
InBlock.gif
<html>
InBlock.gif
<head>
InBlock.gif
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
InBlock.gif
<title>Text Counter</title>
InBlock.gif
</head>
InBlock.gif
<body>
InBlock.gif
<form runat="server">
InBlock.gif    访问人数:
<div id="MyDiv" runat="server"></div>
InBlock.gif
</form>
InBlock.gif
</body>
InBlock.gif
</html>
InBlock.gif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值