導航:首頁 > 編程語言 > 靜態html頁面的訪問量統計代碼

靜態html頁面的訪問量統計代碼

發布時間:2025-03-09 07:02:52

❶ 求生成靜態html頁的代碼

定義 HTML 模板頁面 <html><head><title></title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body><table $htmlformat[0] height="100%" border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#eeeeee" style="border:1px solid #000000"><tr><td width="100%" valign="middle" align="left"><span style="color: $htmlformat[1];font-size: $htmlformat[2]">$htmlformat[3]</span></td></tr></table></body></html>

ASP.NET 代碼示例:------------------讀html模板頁面到stringbuilder對象里---- string[] format=new string[4];//定義和htmlyem標記數目一致的數組 StringBuilder htmltext=new StringBuilder(); try { using (StreamReader sr = new StreamReader("存放模板頁面的路徑和頁面名")) { String line; while ((line = sr.ReadLine()) != null) { htmltext.Append(line); } sr.Close(); } } catch { Response.Write("<Script>alert('讀取文件錯誤')</Script>"); } ------------------給標記數組賦值------------ format[0]="background=\"/blog/bg.jpg\"";format[1]= "#990099";format[2]="150px";format[3]= "<marquee>生成的模板html頁面</marquee>"; //----------替換htm里的標記為你想加的內容 for(int i=0;i<4;i ) { htmltext.Replace("$htmlformat[" i "]",format[i]); } //----------生成htm文件------------------ try { using(StreamWriter sw=new StreamWriter("存放路徑和頁面名",false,System.Text.Encoding.GetEncoding("GB2312"))) { sw.WriteLine(htmltext); sw.Flush(); sw.Close(); } } catch { Response.Write ("The file could not be wirte:"); }

❷ 在HTML靜態網頁中記錄圖片被點擊的次數統計代碼

我也在找,沒找到,就是一個一行兩列的表格里,前一格是文字或一張小圖加上超鏈接,後一格是點了這個文字或圖的鏈接的次數的數字統計,點一次跳+1

❸ 網頁中如何用代碼設置網頁訪問計數器

1、將以下代碼加在你需要得位置; 2、在根目錄下創建名為count的文件夾,並在裡面創建counter.txt文件,文件初始值為0(可更改); 3、將設置好的網頁保存為.asp格式; 4、ok 您是第<span class="style2"> <% Const ForReading = 1, ForWriting = 2, ForAppending =3 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 filepath=server.mappath("/count") filename=filepath+"\counter.txt" set fs=createobject("scripting.filesystemobject") if fs.fileexists(filename) then set f=fs.getfile(filename) Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault) s=ts.readline+1 ts.close else fs.createtextfile(filename) set f=fs.getfile(filename) s=1 end if '向counter.txt中寫數據 Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault) ts.writeline(cstr(s)) ts.close '顯示計數器 s=cstr(s+1000000) s=mid(s,2,8) for I=1 to 8 response.write mid(s,I,1) next %> </span>位訪問者

閱讀全文

與靜態html頁面的訪問量統計代碼相關的資料

熱點內容
jsp集合對象轉json 瀏覽:231
文件櫃在cad裡面長啥樣 瀏覽:554
iphone手機文件保存在哪裡 瀏覽:817
解壓文件後要刷新 瀏覽:786
cc資料庫怎麼獲得時間 瀏覽:226
ug3d硬料開出怎麼編程 瀏覽:151
如何獲取文件Linux命令 瀏覽:981
大智慧軟體哪個版本最好 瀏覽:698
狼人殺自動主持app叫什麼 瀏覽:949
checkbox怎麼綁定資料庫 瀏覽:945
編程怎麼設置一分鍾開燈 瀏覽:754
如何把桌面文件發送到自己郵箱 瀏覽:498
校園網站怎麼看選修的課 瀏覽:59
大數據專業哪個最好 瀏覽:467
一個文件內容替換另一個文件 瀏覽:288
ios8最好的版本 瀏覽:400
錄屏決定文件大小的是什麼 瀏覽:322
數據用不了是哪裡壞掉了 瀏覽:310
百度網盤文件傳輸格式 瀏覽:455
蘋果系統txt文件 瀏覽:629

友情鏈接