星期五, 1月 16, 2009

Azure authorization

In MSDN Azure Authentication Schemes

http://msdn.microsoft.com/en-us/library/dd179428.aspx

Blob and Queue Storage (Shared Key Authentication)

signature example :

"PUT\n\ntext/plain; charset=UTF-8\n\nx-ms-Date:Wed, 17 Sep 2008 20:36:40 GMT\nx-ms-meta-m1:v1\nx-ms-meta-m2:v2\n/testaccount1/storageclientcontainer/hello.txt"


But it not works!!!

-------------------------------------------------------------------------------

In Sergei Meleshchuk's blog

Request authorization in Azure SDK
http://blogs.msdn.com/sergeim/archive/2008/12/10/request-authorization-in-azure-sdk.aspx

The resulting signature string looks like below.

"GET\n\n\n\nx-ms-date:Mon, 01 Dec 2008 05:17:57 GMT\n/accountname/queuename/messages"

And it works...

------------------------------------------------------------------------

The root cause is the "x-ms-date" and "x-ms-Date" are different after HMACSHA256

星期五, 3月 14, 2008

ASP UTF-8 大作戰!

如何讓妳的 ASP PAGE 擁有 unicode 的功能呢?

答案就是使用編碼 UTF-8

內行一點的或許會知道 CODEPAGE

在內行一點的呢,就會知道 NVARCHAR

以下就是必要的程式碼啦

in asp page

'宣告這頁的程式碼是用 65001 編碼,這樣 UTF-8才讀的到喔
<%@ CodePage=65001 %>

'宣告charset=utf-8
<meta equiv="Content-Type" content="text/html; charset=utf-8">

'insert string in asp, 記住要加上N才有unicode編碼!!
"insert into tablee (xxx) Values (N'xxx')"

in sqlserver

xxx這個欄位的type要設定成 NVARCHAR


這樣就大功告成啦!!

星期四, 3月 06, 2008

隱藏表格或欄位

<table width="200" border="1">
<tr style="display:none">
<td>第一欄</td>
</tr>
<tr>
<td>第二欄</td>
</tr>
</table>

只要加上style="display:none",就可以輕鬆隱藏Client的Html元件喔 ^__________^









第一欄
第二欄