跳到主要內容

發表文章

目前顯示的是 8月, 2012的文章

[Web]Create Sitemap.xml

使用Google Analytics做流量分析的時候 會需要製作sitemap.xml 但是如果要自己key那會是件麻煩的工作 不過現在有人提供了製作工具 只要填入你的網站網址就會自動幫你生成 SiteMap製作工具

[CSS]CSS Selector

CSS 選取器方法 這邊有個列表說明CSS的選取器用法 要好好學習CSSS selector一定要熟悉才行 Pattern Meaning Described in section * Matches any element. Universal selector E Matches any E element (i.e., an element of type E). Type selectors E F Matches any F element that is a descendant of an E element. Descendant selectors E > F Matches any F element that is a child of an element E. Child selectors E:first-child Matches element E when E is the first child of its parent. The :first-child pseudo-class E:link E:visited Matches element E if E is the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited). The link pseudo-classes E:active E:hover E:focus Matches E during certain user actions. The dynamic pseudo-classes E:lang(c) Matches element of type E if it is in (human) language c (the document language specifies how language is determined). The :lang() pseudo-class E + F Matches any F element immediately preceded by a sibling element E. Adjacent selectors E

[Asp.net] 在asp.net中加入排程功能

在web的程式中 通常程式要被觸發 是要有使用者進入該網址才會有 但如果想要website的程式在某個時間可以執行某個程序 可以把在Global.asax中 加入Threading.Timer 這樣可以設定在Application啟動後 每隔一段時間去執行某個程序 而不需要有使用者登入web才觸發行為 用法如下 imports System.Web.SessionState Imports System.Threading Imports System.IO Public Class Global_asax     Inherits System.Web.HttpApplication     Dim logTimer As Timer     Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)         ' Fires when the application is started         Dim are As New AutoResetEvent(False)         Dim tcb As New TimerCallback(AddressOf writelog)         logTimer = New Timer(tcb, are, 10000, 60000)     End Sub     '在系統資料夾下寫入log     Public Sub writelog()         '系統程式的路徑         Dim u As String = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath()         Dim filePath As String = u & Now.ToString("yyyyMMdd") & "log.txt"         Application("test") = filePath & " @" & Now.ToString()      

[.Net] 具有潛在危險 Request.Form 的值 Error

在asp.net開發的時候 如果送出Request.From資料中含有html code 往往會被asp.net的驗證檔下來 這個時候可以在 每個aspx的@page中 加上 validateRequest="false" 的設定 如果是asp.net MVC架構 則可以在function 前宣告 ValidateInput(False) 不過要注意 如.net Framework 4.0以上 則要在Web.config中 [system.web1] 下加入 [httpRuntime requestValidationMode="2.0"/]的設定才可以 相關設定可以參考 MSDN

[Web]GenQRCode Web service

QRickit API提供了一個簡單的在頁面產生QRCode圖檔的方式 使用上很簡單,只要把img的src指向QRickit的服務,並傳送要產生文字與參數即可。 方法如下 <img src="http://qrickit.com/api/qr? d=http://anyurl & addtext=Hello+World & txtcolor=442EFF & fgdcolor=76103C & bgdcolor=C0F912 & qrsize=150 & t=p & e=m "> 把其中的anyurl取代成你要的URL 就可以產生對應的QRcode 資料來源: QRickit QR Code API

[JQuery] 好用的 圖片輪播程式JQuery Cycle Plugin

發現一個很好用的圖片輪播程式 JQuery Cycle Plugin 可以設定多種播放模式 還能很快的設定出換頁功能 真的是很方便的元件 $('#picker').cycle({   speed:900,    //速度   timeout:4000, //控制輪播時間  }); 其他的option可參考以下 JQuery Cycle Option JQuery Cycle Plugin

[CSS] CSS水平基準線小工具

幫你在網頁上畫出基本水平基準線的 CSS 小工具,其用法非常簡單,你想在網頁上畫出一個高 24px 的格線,就只要載入以下 CSS,如果高度要改變,直接修改網址上的數字即可。 <link rel="stylesheet" href=" http://basehold.it/24 " >

[ASP] asp判斷瀏覽器的形式

在ASP中可以用Request.ServerVariables("HTTP_USER_AGENT") 找到使用者目前的瀏覽器資訊 因此可以用下面的code來判斷使用者該的瀏覽器 myUA = Request.ServerVariables("HTTP_USER_AGENT") ua = lcase(myUA) if instr(ua,"msie")>0 then Broswer="IE" elseif instr(ua,"firefox")>0 then Broswer="firefox" elseif instr(ua,"chrome")>0 then Broswer="chrome" else Broswer="Other" end if