瀏覽模式: 普通 | 列表

CSS Menu Generator

顧名思義,這是一個利用CSS為基礎的網頁選單產生器,它可以讓你在線上直接針對按鈕的樣式來進行設定,最後產生的code把它貼到你的網頁上就可以使用了。


http://www.webmaster-toolkit.com/css-menu-generator.shtml




SQL Server處理Unicode字串時,前置詞"N"之使用

前一陣子在寫一個中文姓名利用標準拚音翻成英文姓名的元件時,為了處理SQL使用Unicode文字來進行查詢時,遇到一個問題,就是當資料庫的查詢關鍵字是像堃、峯等Unicode字集時,SQL Server會無法辨認而無法查到應有的資料,查了一下微軟的支援服務後,發現在SQL Server中處理Unicode字串常數時,必須在該字串前加上大寫字母 N 做為前置詞(prefix),這樣子才能讓SQL Server在處理該輸入字串時,先行轉為目前資料庫的非Unicode字碼集。

其實這個問題是SQL Server當初在設計時,在6.5版的時候不支援Unicode資料,因此為了後能與未來的版本相容,在日後修正時,為了在不改變系統核心的情況下,將Unicode字碼的轉換工作做在SQL Command底下,但前題是所使用的資料庫版本必須支援Unicode字碼集,也就是SQL Server 7.0以後的版本。

Example:

SELECT * FROM TABLE WHERE NAME LIKE N"%KeyWord%";

在 SQL Server 中處理 Unicode 字串常數時,必需為所有的 Unicode 字串加上前置詞 N
http://support.microsoft.com/kb/239530/zh-tw




使用SQL Server 2005 取得雜湊值

HashBytes (Transact-SQL) 

Returns the MD2, MD4, MD5, SHA, or SHA1 hash of its input.
HashBytes ( '<algorithm>', { @input | 'input' } )  <algorithm>::= MD2 | MD4 | MD5 | SHA | SHA1


Example:

DECLARE @HashThis nvarchar(max);
SELECT @HashThis = CONVERT(nvarchar,'dslfdkjLK85kldhnv$n000#knf');
SELECT HashBytes('SHA1', @HashThis);
GO


取得雜湊值是個二進位varbinary欄位,如要直接取其雜湊碼可利用SQL 2005 master 資料庫內建之 master.dbo.fn_varbintohexstr 預儲程序來進行轉換,使用方法以SHA1為例是
RIGHT(master.dbo.fn_varbintohexstr(HashBytes('SHA1', CONVERT(varchar,欲轉換的資料表欄位名稱))),40)





(.Net 1.1)SHA1與MD5雜湊函數的快速取得法


Using System.Web.FormsAuthentication.HashPasswordForStoringInConfigFile


Example:


FormsAuthentication.HashPasswordForStoringInConfigFile(password , passwordFormat )

參數

password
要做雜湊演算的密碼。
passwordFormat
要使用的雜湊演算。選擇為「sha1」或「md5」。

傳回值

傳回包含雜湊密碼的 String

備註

所支援的密碼演算法為 SHA1 和 MD5。.Net FrameWork 2.0 已支援更多密碼演算法。





CSS Properties To JavaScript Reference Conversion

CSS Property JavaScript Reference
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
clip clip
color color
cursor cursor
display display
filter filter
font font
font-family fontFamily
font-size fontSize
font-variant fontVariant
font-weight fontWeight
height height
left left
letter-spacing letterSpacing
line-height lineHeight
list-style listStyle
list-style-image listStyleImage
list-style-position listStylePosition
list-style-type listStyleType
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
overflow overflow
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
page-break-after pageBreakAfter
page-break-before pageBreakBefore
position position
float styleFloat
text-align textAlign
text-decoration textDecoration
text-decoration: blink textDecorationBlink
text-decoration: line-through textDecorationLineThrough
text-decoration: none textDecorationNone
text-decoration: overline textDecorationOverline
text-decoration: underline textDecorationUnderline
text-indent textIndent
text-transform textTransform
top top
vertical-align verticalAlign
visibility visibility
width width
z-index zIndex

Usage

Internet Explorer

document.all.div_id.style.JS_property_reference = "new_CSS_property_value";

Older Netscape's (4.7 and earlier)

document.div_id.JS_property_reference = "new_CSS_property_value";

Netscape 6.0+ and Opera (and other Mozilla)

document.getElementById(div_id).style.JS_property_reference = "new_CSS_property_value";

Note the use of parentheses instead of square brackets in newer Mozilla's "getElementById()" reference.