發表文章

目前顯示的是 7月, 2010的文章

使用 .NET C# 存取 Google Storage

Google Storage 是 google I/O 2010 發布的服務,目前僅提供測試服務,須取得邀請函才能使用。Google Storage的結構大致上是先建立budget,在budget下面可以建立目錄或放置檔案,檔案可以設定其存取權限是否為公開。目前 Google Storage 提供 Restful api 和 python 的官方程式存取方法,其他語言目前並不提供,不過網路上有熱心人士將它作成各語言的存取api,如C# 有 SharpGs ,開始用程式呼叫前須先取得Google Storage存取金鑰,在 Google Storage首頁 的 Manage your developer keys取得。 C#程式呼叫使用方法如以下簡介 using System; using SharpGs; using System.Collections.Generic; namespace SharpGsDemo { class Program { //存取公私鑰 https://sandbox.google.com/storage/m/manage //AuthKey 公鑰 //AuthSecret 私鑰 private const string AuthKey = @"GOOGP6666666666666666"; private const string AuthSecret = @"usdg/dfhEuiWfwzr4RGfgjdgj/sg+eVojTgDsg"; static void Main() { //建立連接端 var client = GoogleStorageFactory.Create(AuthKey, AuthSecret); //隨機建立Bucket for (var i = 0; i < 10; i++) { // Create a bucket1 client.Creat

ASP.NET Request 驗證

ASP.NET內建提供基本的 request 驗證在表單提交或 postback處理時。每個網頁預設是有 Request 驗證,但是在不同版的 .NET Framework 有不同的處理方法。 ASP.NET 1.1 Request 驗證 Filter "&#" Filter ‘<’ then alphas or ! or / (tags) Filter "script:" Filter on handlers (onXXX=) Filter “expression(“ Ignore elements named "__VIEWSTATE" ASP.NET 2.0 Request 驗證 Filter "&#" Filter ‘<’ then alphas or ! or / (tags) Ignore elements with names prefixed with double underscore (__) ASP.NET 4.0 Request 驗證 所有Request皆執行驗證,HttpHandler和HttpModules甚至靜態網頁 ValidateRequest 設定 單一網頁設定: <%@ Page validateRequest="true|false" %> 整個應用程式設定: <configuration> <system.web> <pages validateRequest="true|false" /> </system.web> </configuration> .NET 4.0 使用2.0方式驗證 <system.web> <httpRuntime requestValidationMode="2.0"/> </system.web>

Google Storage工具

Google Storage 於 Google I/O 2010 中發表,Google Storage是一個功能強大的服務,類似 Amazon S3 的網路檔案儲存的服務,提供檔案儲存,管理和分享等服務,你可以上傳任何大小和類型的檔案。但是目前還處在測試階段,需要邀請碼才能使用,這是 申請網頁 ,基本上有申請都會通過,申請時需要填寫所需容量、流量和request 次數等資訊。 開始使用Google Storage服務時,你可以建立Budget,資料夾和檔案,並上傳,下載和分享檔案,但Google Storage bucket的命名有許多限制,比如字元長度必須3~63之間長度,只能使用小寫字母,數字和_或-等字元,另外不允許建立goog開頭名稱和IP形式名稱如(192.168.5.4),此外如果你創建的Bucket是一個網域名稱的形式(如 www.taicomjp.info ),它會要求你認證這個網域名稱,證明這個網域名稱屬於你,才允許你建立! Google 目前提供了Web的管理工具( Google Storage manager )和客戶端的本文模式工具( GSUtil Tool ),但是Google的web管理工具不支持IE瀏覽器,本文模式工具也不能在Windows平台上執行,且操作不是很方便,對開發人員而言,目前Google只對 python提供相關存取的api ,而其他語言目前僅能使用Restful方式存取,為此許多組織開發了許多第三方的工具。 - Boto *: a Python interface to GS and S3 - CloudBerry : a file manager for Windows - Cyberduck : a browser for Mac - Dasein Cloud : an open source Java API - Data Nucleus : JDO/JPA plug in - Gladinet : maps network drives and provides AFS support - gstore : a Ruby client library - SharpGs : a C# library

Subversion 安裝教學

圖片
Subversion ,簡稱 SVN ,是一個開放原始碼的 版本控制系統 ,相對於的 CVS ,採用了分支管理系統,它的設計目標就是取代CVS。是目前網際網路原始碼版本控制系統主流。 準備工具 Windows SVN (基本上只要安裝此工具即可) TortoiseSVN (SVN圖形化用戶端介面工具)   安裝伺服器端 Windows svn安執行安裝即可 安裝 Svn Server Service sc create subversion_service binpath= "E:\Program Files\Subversion\bin\svnserve.exe --service -r E:\SVNRepos" displayname= "Subversion Repository" depend= Tcpip start= auto ps移除 Svn Server Service sc delete subversion_service 啟動即完成Svn Service服務 選擇你要放置Repository的地方槽。 以下面的例子而言,我們在E槽下面建立了一個名為svn_repo的目錄。 透過您的檔案管理員,在E:\svn_repo的Icon上面,按下滑鼠右鍵後,選擇TortoiseSVN->Create repository here。 接著,您會看到如下的一個視窗,這個視窗主要是問您,您希望使用的Repository資料庫格式是FSFS還是BDB。基本上,請選擇FSFS就可以了。按下OK按鈕後,您將可以看到下一個畫面。 SVN repository已經成功的建立了。接下來就是要把您的專案匯入進來。之後當需要使用這個repository時,就可以使用 file:///E:/SVN_REPO 表示它。SVN就是透過這種URL的方式到如何與Repository取得聯繫。各種URL的格式如下: file:///磁碟機|/repository所在目錄/子目錄 http://帳號@伺服器名