<% =Application("Visitors")%> Welcome to Official Website of Bardhaman District, West Bengal, India.


Please download Java(tm) .

                                                                  

Visitor Counter
<% Dim strPath, File, file2, x,liCount, j ,resfile, d, i ,fl strPath = "counter.txt" strPath = Server.MapPath(strPath) 'We will use the file system object to read and write our counter.txt file. Set File = Server.CreateObject("Scripting.FileSystemObject") set file2=File.OpenTextFile(strPath) 'This will create an instance of the file system object and a file object to access the file represented by strPath. x=file2.readline 'x holds the old value of the counter set resfile = File.createTextFile (strPath) resfile.writeline(x+1) 'This will open the counter file for writing and the value x+1 is written back to it. We can display the value using Response.Write(x+1) but we will display them in a more attractive way. For this we have to create some graphical digits from 0 to 9 and store them in appropriate files like digi0.gif, digi1.gif, digi2.gif, digi3.gif, etc. to digi9.gif. 'This can be created by using any graphics software or can be downloaded from various web sites. We have to count the number of digits our counter value has and to do this we have to first convert our numeric value to a string. liCount=Cstr(x+1) j = Len(liCount) 'We have to decide how many digits our counter will have in total and we will store the difference between this and the value of j in another variable d. The value in d is the number of zeros we have to display to the left of our counter value. For example to display a value of 435 in a 9 digit counter we have to place 6 zeros to the left of 435 and our counter should display 000000435. d=9 - j For i=1 to d step 1 Response.Write ("") Next 'This will display digi0.gif (digit 0) d number of times. Now it’s time to display our counter value. For i=1 to j step 1 'fl="digi" + Mid(liCount, i , 1) + ".gif" 'Response.Write ("" Response.Write (Mid(liCount, i , 1)) Next licount=9999 %>
This site is designed, developed and maintained by
National Informatics Centre(Burdwan District Unit), Department of Information Technology, Ministry of Communications and Information Technology, Govt. of India, New Collectorate Building (3rd floor), Burdwan, West Bengal - 713 101, India
Phone : 91-342-2662582, Email: wbbrd@hub2.nic.in  

<%=x%>

<%=liCount%>