2010年11月11日 星期四

ASP.NET 4.0 Multi Language Design : 即時切換網頁語系的多國語言設計(2)

假設網站中所要執行多國語言的網頁,有套用「主版頁面」的話,打開網站中的Default.aspx,將設計視窗中的文字敘述[歡迎使用 ASP.NET!],改為使用Label控制項取代,並將原本的文字敘述刪除。

<asp:Label ID="LabelMessage" runat="server"  Text="<%$ Resources:MessageResource, Welcome %>" />

clip_image002

接著在網站中預設的Default.aspx中來設計可以讓使用者自行挑選的多國語言網頁設計,其設計步驟如下:

Step 1: 在Default.aspx中加入DropDownList控制項:

<asp:DropDownList ID="ddlLanguage" runat="server" AutoPostBack="True" ClientIDMode="Static">

<asp:ListItem Value="zh-TW">中文</asp:ListItem>

<asp:ListItem Value="en-US">英文</asp:ListItem>

<asp:ListItem Value="ja-JP">日文</asp:ListItem>

</asp:DropDownList>

Step 2: 開啟Default.aspx.vb,改寫InitializeCulture方法,將DropDownList控制項所挑選的值,設定給Page物件的UICulture屬性。

Step 3: 但是因為DropDownList控制項是位在主版頁面的網頁中,因此其所產生之HTML控制項的名稱將會有所異動,那麼就必須要修改Request.Form所要接收的控制項名稱。程式碼如下:

Partial Class _Default

Inherits System.Web.UI.Page

  Protected Overrides Sub InitializeCulture()

    If Request.Form("ctl00$MainContent$ddlLanguage") IsNot Nothing Then

    Dim selectedLanguage As String = _

    Request.Form("ctl00$MainContent$ddlLanguage")

    Page.UICulture = selectedLanguage

  End If

End Sub

End Class

Step 4: 瀏覽Default.aspx,並挑選不同的語系,檢視網頁的執行結果。

clip_image004

Step 5: 當挑選為英文時:

clip_image006

Step 6: 當挑選為日文時:

clip_image008

Step 7: 最後,若是ddlLanguage 這個DropDownList控制項是放置在主版頁面Site.master中的話,那麼在主版頁面中改寫InitializeCulture 方法,其Request.Form所接收的參數值,就可以直接使用ddlLanguage這個ID了。

<script runat="server">

Protected Overrides Sub InitializeCulture()

If Request.Form("ddlLanguage") IsNot Nothing Then

    Page.UICulture = Request.Form("ddlLanguage")

End If

End Sub

</script>

2010年11月10日 星期三

ASP.NET 4.0 Multi Language Design : 即時切換網頁語系的多國語言設計(1)

在設計多國語言的網站時,為了提供更多的彈性讓使用者可以及時切換網頁的語系,在ASP.NET的設計上就必須要考量網頁Page物件以及網頁中控制項之間生命週期以及順序的關係。

舉個例子來說,你要設計一個下拉式選單控制項讓使用者可以挑選後,根據所挑選的資料來改變網頁的語系以及內容,如果挑選英文,那麼網頁的內容要變成英文;如果挑選日文,那麼網頁的內容要變成日文。

問題在於網頁要呈現不同的語言內容必須要在網頁生成之前就要覺得此網頁的語系為何,並決定該怎麼呈現網頁內容。但是控制項的生成卻是在網頁Page生成之後才會Render出來,因此在這邊就必須要使用一個特殊的技巧,那就是改寫Page物件的初始化語系方法:InitializeCulture。

在InitializeCulture中使用Request物件去接收表單所送過來的資料,以判斷該使用那一個語系來設定網頁的語系和呈現方式。下列亞當斯撰寫一個完整的範例讓各位參考,設計步驟如下:

Step 1: 使用Visual Studio 2010建立一個ASP.NET 4.0 網站,命名為:DemoLanguageWebSite。

Step 2: 點選方案總管中的DemoLanguageWebSite,按滑鼠右鍵,選擇「加入新項目」,並挑選「資源檔」,名稱命名為:MessageResource.resx,按下新增。

clip_image002

Step 3: 因為資源檔在網站中是屬於特殊類型檔案,所以預設開發工具會建議將資源檔放在App_GlobalResources資料夾中,當彈跳出以下視窗時,請按下「是」。

clip_image004

Step 4: 在MessageResource.resx檔的編輯視窗中,加入一行資料,名稱是「Welcome」,值為「歡迎使用 ASP.NET!」。

clip_image006

Step 5: 接著複製MessageResource.resx,並在網站的App_GlobalResources資料夾中貼上,修改名稱為:MessageResource.en-US.resx,並且修改資料中Welcome所對應的值為「Welcome to use ASP.NET!」。

clip_image008

Step 6: 同樣的在複製一份MessageResource.resx,並修改名稱為MessageResource.ja-JP.resx,並且修改資料中Welcome所對應的值為「ASP.NETご利用くださいまして、ありがとうございます」。

clip_image010

Step 7: 檢視方案總管中的網站,可以看到目前有三個資源檔位於App_GlobalResources資料夾中,如下圖所示:

clip_image012

Step 8: 新增一個DemoMultiLanguage.aspx網頁到網站中。

Step 9: 拖拉一個Label控制項到DemoMultiLanguage中,命名為LabelMessage,並設定DemoMultiLanguage.aspx中LabelMessage控制項套用至App_GlobalResources中的Resource檔內容。點選LabelMessage控制項,切換到屬性視窗並按下Expressions。

clip_image014

Step 10: 開啟運算式視窗,運算式型別請選擇「Resources」、運算式屬性中的ClassKey設定為「MessageResource」、運算式屬性中的「ResourceKey」設定為「Welcome」,設定完成之後按下確定。

clip_image016

Step 11: 切換DemoMultiLanguage.aspx到原始檔視窗中,可以檢視Label控制項套用Resource檔後的屬性為:

<asp:Label ID="LabelMessage" runat="server"  Text="<%$ Resources:MessageResource, Welcome %>" />

Step 12: 從工具箱中拖拉一個DropDownList控制項到DemoMultiLanguage.aspx中,並設定以下資料:

<asp:DropDownList ID="ddlLanguage" runat="server"  AutoPostBack="True"  ClientIDMode="Static">

<asp:ListItem Value="zh-TW">中文</asp:ListItem>

<asp:ListItem Value="en-US">英文</asp:ListItem>

<asp:ListItem Value="ja-JP">日文</asp:ListItem>

</asp:DropDownList>

Step 13: 在網頁中改寫InitializeCulture方法,將DropDownList控制項所挑選的值,設定給Page物件的UICulture屬性,以便改變網頁所要呈現的不同語言結果,程式碼如下所式:

<script runat="server">

Protected Overrides Sub InitializeCulture()

If Request.Form("ddlLanguage") IsNot Nothing Then

  Page.UICulture = Request.Form("ddlLanguage")

End If

End Sub

</script>

Step 14: 設計完成之後,瀏覽DemoMultiLanguage.aspx,並挑選不同的語系,檢視網頁的執行結果,可以看到當使用者挑選不同語系時,網頁就會切換不同語言的內容。

clip_image018

Step 15: 當挑選英文時:

clip_image020

Step 16: 當挑選日文時:

clip_image022

2010年7月2日 星期五

當選2010年第三季MVP

今天早上收到當選MVP的MAIL,不知道為什麼這次的感覺,是蠻爽的!

可能最近微軟的產品正處於一個新世代的更換,因此連帶著亞當斯在寫書或是開發或是教學的時候,都必須同時具備好幾個不同的執行環境。又是ASP.NET 4.0、又是Visual Studio 2010、又是SharePoint 2010…等等…頭都暈了~

所以很明顯,這一陣子一直狂下載MSDN上的SOURCE,安裝-->執行-->測試-->在安裝…一直都在做這些動作!!而當選MVP的最大好處就是,有一年免費的MSDN訂閱,說老實話,這對亞當斯來說真的是非常之實用,尤其是在這個非常時期。序號不求人,這種feel是很nice的!

以下是MVP MAIL中的訊息,讚,以後要多跟其他MVP交流一下~

親愛的微軟「最有價值專家」(MVP),您好︰
2010年第三季MVP已於7月1日正式公告,以下是當選名單:歡迎各位MVP與微軟技術社群暨最有價值專家部門一同歡迎新成員的加入~
由於有些MVP希望低調,因此,請各位MVP不要公布當選名單於您的部落格或是社群中,感謝~

當選名單
趙敏翔、xxx...

同時,微微軟技術社群暨最有價值專家部門期望每一位MVP能持續發揮熱心助人的微軟「最有價值專家」(MVP)精神─持續積極參與微軟技術論壇、主動且正確地回答他人技術問題。

2010年5月24日 星期一

由於無法啟動使用者執行個體的處理而無法產生SQL Server 的使用者執行個體。此連接將會關閉

這幾天因為某些需求,必須安裝SQL Server 2005 的其他服務,帥小宇說我的NB開發環境太亂了,好吧!我乾脆狠心把SQL Server 重灌,結果重新安裝好SQL Server 2005 Express後,想要使用VS2008或是VS2010加入SQL項目,就產生了如標題的錯誤:由於無法啟動使用者執行個體的處理而無法產生SQL Server 的使用者執行個體。此連接將會關閉

以前根本沒遇到過這個問題,後來猜想有可能當初安裝SQL Server 2005 Express是跟隨著VS.NET 2005 安裝的,因此有一些設定都直接套用好了,現在我的NB上有VS2005,2008,2010…當重新安裝SQL Server 2005 Express有一些地方沒有對應好,好在google了一下,這問題存在已久,也有很多的解決方式:

最簡單的方式就是 :

1.將服務中的SQL Server 2005 Express的登入身分改為:Local System

image

image

2.將 C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS 這個資料夾刪除(我的NB環境是Vista…嗚很想換成W7)

當重新開啟Visual Studio建立資料庫的時候,就會自動產生一個新的SQLEXPRESS 資料夾了。而Visual Studio也就可以正常建立SQLEXPRESS 的資料庫了。

由於無法啟動使用者執行個體的處理而無法產生SQL Server 的使用者執行個體。此連接將會關閉

這幾天因為某些需求,必須安裝SQL Server 2005 的其他服務,derrick說我的NB開發環境太亂了,好吧!我乾脆狠心把SQL Server 重灌,結果重新安裝好SQL Server 2005 Express後,想要使用VS2008或是VS2010加入SQL項目,就產生了如標題的錯誤:由於無法啟動使用者執行個體的處理而無法產生SQL Server 的使用者執行個體。此連接將會關閉

以前根本沒遇到過這個問題,後來猜想有可能當初安裝SQL Server 2005 Express是跟隨著VS.NET 2005 安裝的,因此有一些設定都直接套用好了,現在我的NB上有VS2005,2008,2010…當重新安裝SQL Server 2005 Express有一些地方沒有對應好,好在google了一下,這問題存在已久,也有很多的解決方式:

最簡單的方式就是 :

1.將服務中的SQL Server 2005 Express的登入身分改為:Local System

image

image

2.將 C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS 這個資料夾刪除(我的NB環境是Vista…嗚很想換成W7)

當重新開啟Visual Studio建立資料庫的時候,就會自動產生一個新的SQLEXPRESS 資料夾了。而Visual Studio也就可以正常建立SQLEXPRESS 的資料庫了。

2010年4月25日 星期日

目前 IE 已知的 MIME Types 列表

MIME Type

Description

text/plain

Plain text. Default if data is primarily text and no other type detected.

text/html

HTML. Default if common tags detected and server does not supply image/* type.

text/xml

XML data. Default if data specifies <?xml with an unrecognized DTD.

text/richtext

Rich Text Format (RTF).

text/scriptlet

Microsoft Windows script component.

audio/x-aiff

Audio Interchange File, Macintosh.

audio/basic

Audio file, UNIX.

audio/mid

Internet Explorer 7 and later. MIDI sequence.

audio/wav

Pulse Code Modulation (PCM) Wave audio, Windows.

image/gif

Graphics Interchange Format (GIF).

image/jpeg

JPEG image.

image/pjpeg

Default type for JPEG images.

image/png

Internet Explorer 7 and later. Portable Network Graphics (PNG).

image/x-png

Internet Explorer 7 and later. Default type for PNG images.

image/tiff

Tagged Image File Format (TIFF) image.

image/bmp

Bitmap (BMP) image.

image/x-xbitmap

Removed from Internet Explorer 8.

image/x-jg

AOL Johnson-Grace compressed file.

image/x-emf

Enhanced Metafile (EMF).

image/x-wmf

Windows Metafile Format (WMF).

video/avi

Audio-Video Interleaved (AVI) file.

video/mpeg

MPEG stream file.

application/octet-stream

Binary file. Default if data is primarily binary.

application/postscript

PostScript (.ai, .eps, or .ps) file.

application/base64

Base64-encoded bytes.

application/macbinhex40

BinHex for Macintosh.

application/pdf

Portable Document Format (PDF).

application/xml

XML data. Must be server-supplied. See also "text/xml" type.

application/atom+xml

Internet Explorer 7 and later. Atom Syndication Format feed.

application/rss+xml

Internet Explorer 7 and later. Really Simple Syndication (RSS) feed.

application/x-compressed

UNIX tar file, Gzipped.

application/x-zip-compressed

Compressed archive file.

application/x-gzip-compressed

Gzip compressed archive file.

application/java

Java applet.

application/x-msdownload

Executable (.exe or .dll) file.

2010年4月17日 星期六

ASP.NET 4.0 New Feature : 清單控制項之延伸RepeatLayout功能

CheckBoxList 和 RadioButtonList這兩個清單控制項,在ASP.NET 4.0中的RepeatLayout屬性有做了延伸性的功能加強,在以往的ASP.NET 3.5版本中,RepeatLayout屬性只有兩個選擇可以設定,分別為:Table和Flow。

如果這個屬性設定為 RepeatLayout.Table,則清單中的項目會顯示在資料表,如果這個屬性設定為 RepeatLayout.Flow,則清單中的項目不顯示資料表結構。

例如假設我們把控制項設定為以下設定:

<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatLayout="Flow">

<asp:ListItem Text="CheckBoxList" Value="cbl" />

</asp:CheckBoxList>

 

<asp:RadioButtonList runat="server" RepeatLayout="Table">

<asp:ListItem Text="RadioButtonList" Value="rbl" />

</asp:RadioButtonList>

那麼瀏覽網頁後所得到的HTML將分別轉譯為sapn和table為:

<span id="CheckBoxList1"><input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" />

<label for="CheckBoxList1_0">CheckBoxList</label>

</span>

 

<table id="RadioButtonList1" border="0">

<tr>

<td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1"

value="rbl" />

<label for="RadioButtonList1_0">RadioButtonList</label></td>

</tr>

</table>

那麼ASP.NET 4.0又多了另外兩個選擇設定,分別為:OrderedList 和 UnorderedList,如果這個屬性設定為 RepeatLayout. OrderedList,則清單中的項目會顯示使用ol搭配li設定顯示,如果這個屬性設定為 RepeatLayout. UnorderedList,則清單中的項目會顯示使用ul搭配li設定顯示。

以下假設針對CheckBoxList分別設定RepeatLayout. OrderedList和RepeatLayout. UnorderedList,我們來看看所呈現不同的結果,首先當設定為OrderedList,則如下圖所示,會有順序性的排序編號資料:

clip_image002

如果是設定為UnorderedList,則會呈下如下圖所示,並不會有順序編號,但是會用條列重點方式:

clip_image004

這裡要特別注意一點,假設你設定RepeatLayout為OrderedList 或是 UnorderedList,那麼另一個屬性RepeatDirection就不能設定修改為Horizontal,否則將會出現設計上的錯誤,預設只能搭配Vertical。

image

2010年4月5日 星期一

ASP.NET 網頁控制性的AccessKey屬性簡介與運用

AccessKey:取得或設定便捷鍵 (Access Key),可透過便捷鍵快速巡覽至 Web 伺服器控制項。

例如:將一個輸入控制項TextBox的AccessKey設定為t,那麼當瀏覽網頁後,值需要在鍵盤上按下「ALT + t」,網頁就會把焦點游標放置TextBox控制項上,以下透過範例來示範執行結果,操作步驟為:

Step 1: 新增一個網頁,命名為:DemoAccessKey.aspx

Step 2: 從工具箱中拖曳一個Button和一個TextBox控制項到網頁設計視窗中。

Step 3: 設定TextBox控制項的AccessKey為t。

clip_image002

Step 4: 設定Button控制項的AccessKey為t,並且雙擊Button控制項在Button的Click事件中,撰寫以下程式碼,當點下按鈕之後,便會在網頁上輸入一字串「按到了Button按鈕」:

<script runat="server">

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Response.Write("按到了Button按鈕")

End Sub

</script>

Step 5: 設計好之後,瀏覽DemoAccessKey.aspx網頁。

Step 6: 按下鍵盤「ALT + t」,檢視網頁的結果,可以看到游標停在TextBox上。

clip_image004

Step 7: 按下鍵盤「ALT + b」,檢視網頁的結果,可以看到網頁上輸出了字串「按到了Button按鈕」,代表按鈕已經被觸發。

clip_image006

2010年3月13日 星期六

70-516 MCTS: Accessing Data with Microsoft .NET Framework 4 考試參考大綱

ADO.NET的認證自從ADO.NET 3.5 版之後就獨立出一門認證,完全和ASP.NET以及Winform分庭抗禮,其實以開發系統的角度來說,這一張認證才真的是了不起,因為涵蓋所有的資料存取技術,包含以下幾個主要的技巧都必須要專精才行

  • ADO.NET 4 coding techniques and framework components
  • ADO.NET Data Services LINQ
  • LINQ to SQL
  • Entity Framework technologies
  • Structured Query Language (SQL) 
  • stored procedures
  • Database Structures/Schemas (Objects) XML

以上的是大項,以下整理ADO.NET4.0比較細項的考試大綱以及配置範圍,以供參考:

Modeling Data (20%)

  • Map entities and relationships by using the Entity Data Model.
    This objective may include but is not limited to: using the Visual Designer, building an entity data model from an existing database, managing complex entity mappings in EDMX, editing EDM XML, mapping to stored procedures, creating user-defined associations between entities, generating classes with inheritance and mapping them to tables
    This objective does not include: using MetadataWorkspace
  • Map entities and relationships by using LINQ to SQL.

    This objective may include but is not limited to: using the Visual Designer, building a LINQ to SQL model from an existing database, mapping to stored procedures

  • Create and customize entity objects.

    This objective may include but is not limited to: configuring changes to an Entity Framework entity, using the ADO.NET EntityObject Generator (T4), extending, self-tracking entities, snapshot change tracking, ObjectStateManager, partial classes, partial methods in the Entity Framework

  • Connect a POCO model to the Entity Framework.
    This objective may include but is not limited to: implementing the Entity Framework with persistence ignorance, user-created POCO entities
    This objective does not include: using the POCO templates
  • Create the database from the Entity Framework model.

    This objective may include but is not limited to: customizing the Data Definition Language (DDL) (templates) generation process, generating scripts for a database, Entity Data Model tools

  • Create model-defined functions.

    This objective may include but is not limited to: editing the Conceptual Schema Definition Language CSDL, enabling model-defined functions by using the EdmFunction attribute, complex types

Managing Connections and Context (18%)

  • Configure connection strings and providers.
    This objective may include but is not limited to: managing connection strings including Entity Framework connection strings, using the ConfigurationManager, correctly addressing the Microsoft SQL Server instance, implementing connection pooling, managing User Instanceand AttachDBfilename, switching providers, implementing multiple active result sets (MARS)
    This objective does not include: using the ConnectionStringBuilder; Oracle data provider; creating and using a custom provider; using third-party providers
  • Create and manage a data connection.

    This objective may include but is not limited to: connecting to a data source, closing connections, maintaining the life cycle of a connection

  • Secure a connection.
    This objective may include but is not limited to: encrypting and decrypting connection strings, using Security Support Provider Interface (SSPI) or SQL Server authentication, read only vs. read/write connections
    This objective does not include:  Secure Sockets Layer (SSL)
  • Manage the DataContext and ObjectContext.

    This objective may include but is not limited to: managing the life cycle of DataContext and ObjectContext, extending the DataContext and ObjectContext, supporting POCO

  • Implement eager loading.
    This objective may include but is not limited to: configuring loading strategy by using LazyLoadingEnabled, supporting lazy loading with POCO, explicitly loading entities
  • Cache data.
    This objective may include but is not limited to: DataContext and ObjectContext cache including identity map, local data cache
    This objective does not include: Velocity, SqlCacheDependency
  • Configure ADO.NET Data Services.

    This objective may include but is not limited to: creating access rules for entities, configuring authorization and authentication, configuring HTTP verbs

Querying Data (22%)

  • Execute a SQL query.

    This objective may include but is not limited to: DBCommand, DataReader, DataAdapters, DataSets, managing data retrieval by using stored procedures, using parameters, System.Data.Common namespace classes

  • Create a LINQ query.
    This objective may include but is not limited to: syntax-based and method-based queries, joining, filtering, sorting, grouping, aggregation, lambda expressions, paging, projection
    This objective does not include: compiling queries
  • Create an Entity SQL (ESQL) query.

    This objective may include but is not limited to: joining, filtering, sorting, grouping, aggregation, paging, using functions, query plan caching, returning a reference to an entity instance, using parameters with ESQL, functionality related to EntityClient classes

  • Handle special data types.
    This objective may include but is not limited to: querying BLOBs, filestream, spatial and table-valued parameters
    This objective does not include: implementing data types for unstructured data, user-defined types, Common Language Runtime (CLR) types
  • Query XML.
    This objective may include but is not limited to: LINQ to XML, XmlReader, XmlDocuments, XPath
    This objective does not include: XSLT, XmlWriter
  • Query data by using ADO.NET Data Services.

    This objective may include but is not limited to: implementing filtering and entitlement in ADO.NET Data Services, addressing resources, creating a query expression, accessing payload formats, Data Services interceptors

Manipulating Data (22%)

  • Create, update, or delete data by using SQL statements.

    This objective may include but is not limited to: Create/Update/Delete (CUD), using DataSets, calling stored procedures, using parameters

  • Create, update, or delete data by using DataContext.
    This objective may include but is not limited to: CUD, calling stored procedures, using parameters
    This objective does not include: ObjectTrackingEnabled
  • Create, update, or delete data by using ObjectContext.

    This objective may include but is not limited to: CUD, calling stored procedures, using parameters, setting SaveOptions

  • Manage transactions.
    This objective may include
    but is not limited to: System.Transactions, DBTransaction, rolling back a transaction, Lightweight Transaction Manager (LTM)

    This objective does not include: distributed transactions, multiple updates within a transaction, multiple synchronization of data within an acidic transaction

  • Create disconnected objects.

    This objective may include but is not limited to: creating self-tracking entities in the Entity Framework, attaching objects, DataSets, table adapters

Developing and Deploying Reliable Applications (18%)

  • Monitor and collect performance data.

    This objective may include but is not limited to: logging generated SQL (ToTraceString), collecting response times, implementing performance counters, implementing logging, implementing instrumentation

  • Handle exceptions.

    This objective may include but is not limited to: resolving data concurrency issues (handling OptimisticConcurrency exception, Refresh method), handling errors, transaction exceptions, connection exceptions, timeout exceptions, handling an exception from the Entity Framework disconnected object, security exceptions

  • Protect data.

    This objective may include but is not limited to: encryption, digital signature, hashing, salting, least privilege

  • Synchronize data.

    This objective may include but is not limited to: online/offline Entity Framework, synchronization services, saving locally

  • Deploy ADO.NET components.

    This objective may include but is not limited to: packaging and publishing from Visual Studio, deploying an ADO.NET Services application; packaging and deploying Entity Framework metadata

    This objective does not include: configuring IIS, MSDeploy, MSBuild

以上大綱整理來自微軟官方網站,如想得知認證更詳細資料,請參考:http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-516&locale=en-us#tab1

2010年3月12日 星期五

70-513 MCTS: WCF Development with Microsoft .NET Framework 4 考試參考大綱

考70-513這科考試除了可以取得 MCTS: Windows Communication Foundation Development with Microsoft .NET Framework 4 之外,也是MCPD: Windows Developer 4 或是 MCPD: Web Developer 4 可以選考的科目之一,基本上WCF到了.NET 4.0的時候並沒有翻天覆地的大改變,雖有新功能的加持,不過底層架構還是一樣,這讓亞當斯慶幸不少。

不像WF 流程那可就真的是翻天覆地的架構大異動,所以我猜想WF的認證考試一定變更難,因此到目前為止,ASP.NET 4.0、ADO.NET 4.0、WCF 的認證範圍都大致上有個雛形了,但是卻尚未看到WF的身影,由此可知一般。

以下整理列出WCF考試的範疇以及配置內容:

Creating Services (20%)

  • Create service and operation contracts.

    This objective may include but is not limited to: one-way, duplex, and request reply; creating and specifying  fault contracts; configuration-based contracts; exposing service metadata; selecting serialization (e.g., data contract serializer vs. XML serializer)

    This objective does not include: designing service and operation contracts; transactions, instantiation, security-related attributes

  • Create data contracts.

    This objective may include but is not limited to: managing Known Types; controlling data serialization; using required and order attributes on data members; implementing versioning using IExtensibleDataObject; POCOs

    This objective does not include: using custom serializer (ISerializationSurrogate)

  • Create message contracts.

    This objective may include but is not limited to: body and header elements; using required and order attributes on members

  • Implement generic message handling.

    This objective may include but is not limited to: creating a catch-all contract; reading and writing messages; working with properties; working with headers

    This objective does not include: inheriting from Message class; using BodyWriter; creating Fault messages

  • Implement RESTful services.

    This objective may include but is not limited to: accessing HTTP context; WebGet/WebInvoke, UriTemplates; JSON/POX

  • Create and configure a Routing service.

    This objective may include but is not limited to: filters, static and dynamic, context-based routing, content-based routing; router interfaces

  • Create and configure a Discovery service.

    This objective may include but is not limited to: configuring ad hoc and managed modes; Discovery scopes; service announcements

Hosting and Configuring Services (18%)

  • Create and configure endpoints.

    This objective may include but is not limited to: default and standard bindings; custom bindings created from standard binding elements; standard endpoints; transports including HTTP, TCP, named pipes, UDP, MSMQ code-based service configuration; message encoding

    This objective does not include: creating a custom binding element; creating new standard endpoints, loading configuration from a location other than the default application configuration file, security, transaction, reliable sessions

  • Configure Behaviors.

    This objective may include but is not limited to: applying service, endpoint, and operation behaviors in configuration and code

    This objective does not include: creating a custom behavior; creating and using dispatch behaviors,loading configuration from a location other than the default application configuration file

  • Implement self hosting.

    This objective may include but is not limited to: configuring and instantiating a service host

    This objective does not include: implementing a custom service host

  • Implement Web server hosting.

    This objective may include but is not limited to: configuring IIS/WAS for WCF; deploying to IIS/WAS; file-less configuration; specifying a ServiceHost

    This objective does not include: Windows Application Server

Consuming Services (19%)

  • Create a service proxy.

    This objective may include but is not limited to: using a proxy class or channel factory to create a proxy; creating a proxy for an asynchronous communication; creating a proxy for a duplex communication

    This objective does not include: SvcUtil command-line switches

  • Configure client endpoints.

    This objective may include but is not limited to: standard bindings, custom bindings created from standard binding elements, configuring behaviors; code-based and configuration-based bindings; configuring addresses

    This objective does not include: security; creating custom behaviors

  • Invoke a service.

    This objective may include but is not limited to: invoking a service operation synchronously and asynchronously; handling service faults ; using the Message class; managing the life cycle of the proxy (open channels, close channels, abort channels, handle faulted channels); implementing duplex communication

  • Consume RESTful services.

    This objective may include but is not limited to: access HTTP context; JSON/POX

  • Implement service Discovery.

    This objective may include but is not limited to: configuring target scope; monitoring service announcements

Securing Services (17%)

  • Configure secure Bindings.

    This objective may include but is not limited to: transport, message, mixed mode

  • Configure message security.

    This objective may include but is not limited to: specifying protection levels on different message parts

  • Implement Authentication.

    This objective may include but is not limited to: Microsoft ASP.NET Membership Provider, Custom Provider, Windows Integrated Security, certificates (X.509), Federated Authentication endpoint identity; configuring client credentials; Custom Validator

    This objective does not include: Geneva Framework

  • Implement Authorization.

    This objective may include but is not limited to: role based, claim based; configuring role providers for endpoints; principal permission attribute

    This objective does not include: rights-management authorization such as Active Directory Rights Management Services (AD RMS)

  • Implement Impersonation.

    This objective may include but is not limited to: configuration and code; configuring WCF-specific Internet Information Services (IIS) impersonation properties; configuring impersonation options; operation-based and service-based

  • Implement security auditing.

    This objective may include but is not limited to: using serviceSecurityAudit behavior, service auditing, audit log

Managing the Service Instance Life Cycle (13%)

  • Manage service instances.

    This objective may include but is not limited to: per call; per session; single; code and configuration; activation and deactivation; durable services; throttling

  • Manage sessions.

    This objective may include but is not limited to: code and configuration; session management attributes; throttling; reliable sessions; transport-level and application-level sessions; invoking a callback contract

  • Implement transactions.

    This objective may include but is not limited to: distributed transactions; transactional queues;transaction flow; configuring transaction binding attributes; WS-AtomicTransaction (WS-AT); transactional behavior attributes at the service and operation level; using transactions in code

  • Manage concurrency.

    This objective may include but is not limited to: single, multiple, and reentrant concurrency modes; SynchronizationContext and CallbackBehavior

    This objective does not include: deadlocks and other multithreading issues

  • Manage consistency between instances, sessions, transactions, and concurrency.

    This objective may include but is not limited to: possible combinations between instances, sessions, transactions, and concurrency (for example, instance mode single with concurrency mode multiple)

Monitoring and Troubleshooting Distributed Systems (14%)

  • Configure message logging.

    This objective may include but is not limited to: configuring message listeners; logging level; message filters; configuring logging known PII

    This objective does not include: secure message logs

  • Configure diagnostics.

    This objective may include but is not limited to: WMI; performance counters; event logging

  • Debug client-service interactions.

    This objective may include but is not limited to: sending server exception details to client; end-to-end tracing; interpreting output from the trace viewer (single message and end to end)

    This objective does not include: tracing viewer features outside of viewing traces

以上大綱整理來自微軟官方網站,如想得知認證更詳細資料,請參考:http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-513&locale=en-us#tab1

2010年3月11日 星期四

70-519 MCPD : Designing and Developing Web Applications Using Microsoft .NET Framework 4 考試參考大綱

70-515是考ASP.NET 4.0基礎的MCTS,而這科70-519則是屬於進階內容,所以認證部分是屬於MCPD的範疇,也就是Pro級的,同樣的亞當斯將考試參考大綱整理條列如下,有興趣的朋友請自行參考:

Designing the Application Architecture (19%)

  • Plan the division of application logic.
    This objective may include but is not limited to: choosing between client-side and server side processing, planning separation of concern, (for example, partitioning functionality between controllers and evaluating business and data service consumption), planning for long-running processes (for example, synchronous vs. asynchronous)

  • Analyze requirements and recommend a system topology.
    This objective may include but is not limited to: designing interaction between applications, mapping logical design to physical implementation, validating nonfunctional requirements and cross-cutting concerns (for example, communications, operations management, and security), evaluating baseline needs (for example, scale and quality of service)
  • Choose appropriate client-side technologies.
    This objective may include but is not limited to: JavaScript, ASP.NET AJAX, jQuery, Microsoft Silverlight
  • Choose appropriate server-side technologies.
    This objective may include but is not limited to: user controls, server controls, partials, custom HtmlHelper extensions, Web parts, inheriting controls, dynamic data controls
  • Design state management.
    This objective may include but is not limited to: designing an application for the proper use of application state, session state, and request state (for example, ViewState, ControlState, Cache object, cookies, and client-side persistence)

Designing the User Experience (17%)

  • Design the site structure.

    This objective may include but is not limited to: designing application segmentation for manageability and security (for example, using areas, shared views, master pages, and nested master pages), appropriate use of style sheets, client-side scripting, themes, client ID generation, rendering element modes, routing engine

  • Plan for cross-browser and/or form factors.

    This objective may include but is not limited to: evaluating the impact on client side behaviors, themes, bandwidth, style sheets (including application design - task based or scaled rendering of existing page), when to apply Browsers file, structural approaches, user agents, different platforms (mobile vs. desktop)

  • Plan for globalization.

    This objective may include but is not limited to: designing to support local, regional, language, or cultural preferences, including UI vs. data localization (for example, implementing at database level or resource level), when to use CurrentCulture vs. CurrentUICulture, globalization rollout plan (for example, setting base default language, planning localization), handling Unicode data (for example, what fields to include, request encoding), right-to-left support, vertical text and non-Latin topographies, calendars, data formatting, sorting

Designing Data Strategies and Structures (18%)

  • Design data access.

    This objective may include but is not limited to: choosing data access technologies such as ADO.NETData Services, Entity Framework, Windows Communications Foundation (WCF), and ASP.NET Web Services

  • Design data presentation and interaction.

    This objective may include but is not limited to: pulling data from data layer and binding into views, pages, and controls, and pulling data back to data layer by using ModelBinders, data source controls, and HtmlHelper extensions, or programmatically

  • Plan for data validation.

    This objective may include but is not limited to: contextual validation vs. data integrity, where to validate data, synchronization between UI and data layer, data annotations

Designing Security Architecture and Implementation (17%)

  • Plan for operational security.

    This objective may include but is not limited to: approaches for process- and resource-level security, including local and remote resources, Code Access Security (CAS), including trust level, process identity, application pool, and identity tag

  • Design an authentication and authorization model.

    This objective may include but is not limited to: authentication providers, including WindowsForms, and custom user identity flowthrough (for example, trusted subsystem), role management, membership providers, URL authorization (for example, AuthorizationAttribute), file authorization, Authorization Manager (AzMan)

  • Plan for minimizing attack surfaces.

    This objective may include but is not limited to: input validation, throttling inputs, request filtering, where to use Secure Sockets Layer (SSL)

Preparing For and Investigating Application Issues (15%)

  • Choose a testing methodology.

    This objective may include but is not limited to: black box, white box, integration, regression, coverage, API testing, performance testing, security testing
    This objective does not include: load testing, Web testing, unit testing

  • Design an exception handling strategy.

    This objective may include but is not limited to: HandleError attribute in MVC, common error pages, post-error processing, global vs. page level

  • Recommend an approach to debugging.

    This objective may include but is not limited to: tools and approaches for a given scenario (for example, memory dumps, DebuggingAttributes, crashes vs. hangs, deadlocks, assembly binding), when to attach to process (Visual Studio Development Server vs. IIS vs. Internet Explorer), root cause analysis

    This objective does not include: basic breakpoints

  • Recommend an approach to performance issues.

    This objective may include but is not limited to: which instrumentation to watch or create (including performance counters and event tracing) to analyze performance issues, page and fragment caching

Designing a Deployment Strategy (14%)

  • Design a deployment process.

    This objective may include but is not limited to: Windows Installer (MSI) vs. xcopy vs. Web Deployment Tool, scaling, rolling deployments

  • Design configuration management.

    This objective may include but is not limited to: using the ConfigSource attribute (for example, connection strings), staging vs. production vs. development, topologies, machine.config vs. web.config, using IIS vs. Visual Studio Development Server during development, application pools, configuration inheritance

  • Plan for scalability and reliability.

    This objective may include but is not limited to: scaling up, scaling out, at physical level and at architectural level, impact of offloading technologies on load balancing, including state, synchronizing machine and encryption keys

  • Design a health monitoring strategy.

    This objective may include but is not limited to: when to monitor application or business-related events (e.g., on UI every time clicked or in business layer), determining a strategy for using ASP.NET Health Monitoring, throttling, filtering, delivery method

以上參考資料來自微軟官網:http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-519&locale=en-us#,如想了解詳情可以去研究看看。

2010年3月10日 星期三

70-515 MCTS: Web Applications Development with Microsoft .NET Framework 4 考試大綱參考

ASP.NET 4.0 的認證考試MCTS大綱已經出來各大概了,這次看來會考很多新的技術,例如:jQuery、Chart、QueryExtender,、EntityDataSource 、LINQ、MVC… …等等,亞當斯把微軟官方網站所條列之重點與比例列在下方提供給各位參考:

Developing Web Forms Pages (19%)

  • Configure Web Forms pages.
    This objective may include but is not limited to: page directives such as ViewState, request validation, event validation, MasterPageFile; ClientIDMode; using web.config; setting the html doctype
    This objective does not include: referencing a master page; adding a title to a Web form
  • Implement master pages and themes.
    This objective may include but is not limited to: creating and applying themes; adding multiple content placeholders; nested master pages; control skins; passing messages between master pages; switching between themes at runtime; loading themes at run time; applying a validation schema
    This objective does not include: creating a master page; basic content pages
  • Implement globalization.
    This objective may include but is not limited to: resource files, browser files, CurrentCulture, currentUICulture, ASP:Localize
  • Handle page life cycle events.
    This objective may include but is not limited to: IsPostback, IsValid, dynamically creating controls, control availability within the page life cycle, accessing control values on postback, overriding page events
  • Implement caching.
    This objective may include but is not limited to: data caching; page output caching; control output caching; cache dependencies; setting cache lifetimes; substitution control
    This objective does not include: distributed caching (Velocity)
  • Manage state.
    This objective may include but is not limited to: server-side technologies, for example, session and application; client-side technologies, for example, cookies and ViewState; configuring session state (in proc, state server, Microsoft SQL Server; cookieless); session state compression; persisting data by using ViewState; compressing ViewState; moving ViewState

Developing and Using Web Forms Controls (18%)

  • Validate user input.
    This objective may include but is not limited to: client side, server side, and via AJAX; custom validation controls; regex validation; validation groups; datatype check; jQuery validation
    This objective does not include: RangeValidator and RequiredValidator
  • Create page layout.
    This objective may include but is not limited to: AssociatedControlID; Web parts; navigation controls; FileUpload controls
    This objective does not include:  label; placeholder, panel controls; CSS, HTML, referencing CSS files, inlining
  • Implement user controls.
    This objective may include but is not limited to: registering a control; adding a user control; referencing a user control; dynamically loading a user control; custom event; custom properties; setting toolbox visibility
  • Implement server controls.
    This objective may include but is not limited to: composite controls, INamingContainer, adding a server control to the toolbox, global assembly cache, creating a custom control event, globally registering from web.config; TypeConverters
    This objective does not include: postback data handler, custom databound controls, templated control
  • Manipulate user interface controls from code-behind.
    This objective may include but is not limited to: HTML encoding to avoid cross-site scripting, navigating through and manipulating the control hierarchy; FindControl; controlRenderingCompatibilityVersion; URL encoding; RenderOuterTable
    This objective does not include: Visibility, Text, Enabled properties

Implementing Client-Side Scripting and AJAX (16%)

  • Add dynamic features to a page by using JavaScript.
    This objective may include but is not limited to: referencing c
    lient ID; Script Manager; Script combining; Page.clientscript.registerclientscriptblock; Page.clientscript.registerclientscriptinclude; sys.require (scriptloader)
    This objective does not include: interacting with the server; referencing JavaScript files; inlining JavaScript
  • Alter a page dynamically by manipulating the DOM.
    This objective may include but is not limited to: using jQuery, adding, modifying, or removing page elements, adding effects, jQuery selectors
    This objective does not include: AJAX
  • Handle JavaScript events.
    This objective may include but is not limited to: DOM events, custom events, handling events by using jQuery
  • Implement ASP.NET AJAX.
    This objective may include but is not limited to: client-side templating, creating a script service, extenders (ASP.NET AJAX Control Toolkit), interacting with the server, Microsoft AJAX Client Library, custom extenders; multiple update panels; triggers; UpdatePanel.UpdateMode; Timer
    This objective does not include: basic update panel and progress
  • Implement AJAX by using jQuery.
    This objective may include but is not limited to: $.get, $.post, $.getJSON, $.ajax, xml, html, JavaScript Object Notation (JSON), handling return types
    This objective does not include: creating a service

Configuring and Extending a Web Application (15%)

  • Configure authentication and authorization.
    This objective may include but is not limited to: using membership, using login controls, roles, location element, protecting an area of a site or a page
    This objective does not include:  Windows Live; Microsoft Passport; Windows and Forms authentication
  • Configure providers.
    This objective may include but is not limited to: role, membership, personalization, aspnet_regsql.exe
    This objective does not include: creating custom providers
  • Create and configure HttpHandlers and HttpModules.
    This objective may include but is not limited to: generic handlers, asynchronous handlers, setting MIME types and other content headers, wiring modules to application events
  • Configure initialization and error handling.
    This objective may include but is not limited to: handling Application_Start, Session_Start, and Application_BeginRequest in global.asax, capturing unhandled exceptions, custom error section of web.config, redirecting to an error page; try and catch; creating custom exceptions
  • Reference and configure ASMX and WCF services.
    This objective may include but is not limited to: adding service reference, adding Web reference, changing endpoints, wsdl.exe, svcutil.exe; updating service URL; shared WCF contracts assembly
    This objective does not include: creating WCF and ASMX services
  • Configure projects and solutions, and reference assemblies.
    This objective may include but is not limited to: local assemblies, shared assemblies (global assembly cache), Web application projects, solutions, settings file, configuring a Web application by using web.config or multiple .config files; assemblyinfo
  • Debug a Web application.
    This objective may include but is not limited to: remote, local, JavaScript debugging, attaching to process, logging and tracing, using local IIS, aspnet_regiis.exe
  • Deploy a Web application.
    This objective may include but is not limited to: pre-compilation, publishing methods (e.g.,
    MSDeploy, xcopy, and FTP), deploying an MVC application
    This objective does not include: application pools, IIS configuration

Displaying and Manipulating Data (19%)

  • Implement data-bound controls.
    This objective may include but is not limited to: advanced customization of DataList, Repeater, ListView, FormsView, DetailsView, TreeView, DataPager, Chart, GridView
    This objective does not include: working in Design mode
  • Implement DataSource controls.
    This objective may include but is not limited to: ObjectDataSource, LinqDataSource, XmlDataSource, SqlDataSource, QueryExtender, EntityDataSource
    This objective does not include: AccessDataSource, SiteMapDataSource
  • Query and manipulate data by using LINQ.
    This objective may include but is not limited to: transforming data by using LINQ to create XML or JSON, LINQ to SQL, LINQ to Entities, LINQ to objects, managing DataContext lifetime
    This objective does not include: basic LINQ to SQL
  • Create and consume a data service.

    This objective may include but is not limited to: WCF, Web service; server to server calls; JSON serialization, XML serialization
    This objective does not include: client side, ADO.NET Data Services

  • Create and configure a Dynamic Data project.
    This objective may include but is not limited to: dynamic data controls, custom field templates; connecting to DataContext and ObjectContext

Developing a Web Application by Using ASP.NET MVC 2 (13%)

  • Create custom routes.
    This objective may include but is not limited to: route constraints, route defaults, ignore routes, custom route parameters
  • Create controllers and actions.
    This objective may include but is not limited to: Visual Studio support for right-click context menus; action filters (including Authorize, AcceptVerbs, and custom) and model binders; ActionResult sub-classes
  • Structure an ASP.NET MVC application.
    This objective may include but is not limited to: single project areas (for example, route registration, Visual Studio tooling, and inter-area links); organizing controllers into areas; shared views; content files and folders
  • Create and customize views.
    This objective may include but is not limited to: built-in and custom HTML helpers (for example, HTML.RenderAction and HTML.RenderPartial), strongly typed views, static page checking, templated input helpers, ViewMasterPage, ViewUserControl
    This objective does not include: Microsoft.Web.Mvc Futures assembly

以上所有資料來自微軟官網,網址為 : http://www.microsoft.com/learning/en/us/Exam.aspx?ID=70-515&Locale=en-us#tab1

2010年3月9日 星期二

70-511 MCTS: Windows Applications Development with Microsoft .NET Framework 4 考試大綱參考

Windows Form 4.0 的認證考試MCTS大綱已經出來各大概了,不過好像現在考Windows Form 的人比較少,亞當斯把微軟官方網站所條列之重點與比例,整理在下方提供給各位參考:

Building a User Interface by Using Basic Techniques (23%)

  • Choose the most appropriate control class.

    This objective may include but is not limited to: evaluating design requirements and then selecting the most appropriate control based on those requirements; recognizing when none of the standard controls meet requirements; item controls, menu controls, content controls

    This objective does not include: designing a custom control

  • Implement screen layout by using nested control hierarchies.

    This objective may include but is not limited to: using panel-derived controls, attaching properties

    This objective does not include: items controls, control customization

  • Create and apply styles and theming.

    This objective may include but is not limited to: application-level styles, overriding styles, style inheritance, Generic.xaml,  theming attributes

    This objective does not include: data-grid view style sharing

  • Manage reusable resources.

    This objective may include but is not limited to: fonts, styles, data sources, images, resource dictionaries, resource-only DLLs

  • Implement an animation in WPF.

    This objective may include but is not limited to: creating a storyboard; controlling timelines; controlling the behavior when the animation completes; double, color, and point animations; starting an animation from code and from XAML

    This objective does not include: direct rendering updates, implementing key frame animations

Enhancing a User Interface by Using Advanced Techniques (21%)

  • Manage routed events in WPF.

    This objective may include but is not limited to: tunneling vs. bubbling events, handling and cancelling events

    This objective does not include: simple event handling; creating custom events

  • Configure WPF commanding.

    This objective may include but is not limited to: defining WPF commands based on RoutedCommand; associating commands to controls; handling commands; command bindings; input gestures  

    This objective does not include: creating custom commands by implementing ICommand

  • Modify the visual interface at run time.

    This objective may include but is not limited to: adding/removing controls at run time; manipulating the visual tree; control life cycle; generating a template dynamically

    This objective does not include: instantiating forms and simple modification of control properties at runtime

  • Implement user-defined controls.

    This objective may include but is not limited to: deciding whether to use a user/composite, extended, or custom control ; creating a user/composite control; extending from an existing control

    This objective does not include: creating a custom control by inheriting directly from the Control class and writing code

  • Create and display graphics.

    This objective may include but is not limited to: creating and displaying graphics by using geometric transformation; brushes; drawing shapes; clipping; double buffering; overriding Render (WPF) and OnPaint (WinForms); differentiating between retained and non-retained graphics

    This objective does not include: creating and displaying three-dimensional graphics; hit testing; creating images

  • Add multimedia content to an application in WPF.

    This objective may include but is not limited to: media player vs. media element; adding a sound player; images

    This objective does not include: buffering

  • Create and apply control templates in WPF.

    This objective may include but is not limited to: template binding

    This objective does not include: styling and theming; data templating

  • Create data, event, and property triggers in WPF.

Managing Data at the User Interface Layer (23%)

  • Implement data binding.

    This objective may include but is not limited to: binding options, static and dynamic resources, element bindings, setting the correct binding mode and update mode; binding to nullable values

    This objective does not include: binding to a specific data source

  • Implement value converters in WPF.

    This objective may include but is not limited to: implementing custom value converters, implementing multivalue converters

  • Implement data validation.

    This objective may include but is not limited to: handling validation and providing user feedback via the error provider (WinForms) or data templates (WPF), IDataErrorInfo, validation control, form validation and control validation

  • Implement and consume change notification interfaces.

    This objective may include but is not limited to: implementing INotifyPropertyChanged; using INotifyCollectionChanged (ObservableCollection)

  • Prepare collections of data for display.

    This objective may include but is not limited to: filtering, sorting, and grouping data; LINQ; CollectionView (WPF), BindingSource object (WinForms)

  • Bind to hierarchical data.

    This objective may include but is not limited to: TreeView; MenuControl

  • Implement data-bound controls.

    This objective may include but is not limited to: using the DataGridView (WinForms) or DataGrid (WPF) control to display and update the data contained in a data source, implementing complex data binding to integrate data from multiple sources; ItemsControl-derived controls (WPF)

  • Create a data template in WPF.

    This objective may include but is not limited to: implementing a data template selector; using templates with ItemsControl

Enhancing the Functionality and Usability of a Solution (17%)

  • Integrate WinForms and WPF within an application.

    This objective may include but is not limited to: using ElementHosts within WinForms and ControlHosts within WPF; using the PropertyMap property

  • Implement asynchronous processes and threading.

    This objective may include but is not limited to: implementing asynchronous programming patterns; marshalling between threads; freezing UI elements; using timers; Task Parallel Library; parallel LINQ; using the dispatcher; BackgroundWorker component

  • Incorporate globalization and localization features.

    This objective may include but is not limited to: loading resources by locale; marking localizable elements; using culture settings in validators and converters; using language properties and rendering direction properties; working with resource files for localization; determining installed locales; regional settings

  • Implement drag and drop operations within and across applications.

    This objective does not include: Dynamic Data Exchange (DDE)

  • Implement security features of an application.

    This objective may include but is not limited to: configuring Software Restriction Policy (SRP); full trust and partially trusted security; interoperability with legacy CAS policy; User Account Control (UAC)

  • Manage user and application settings.

    This objective may include but is not limited to: creating application settings; creating user settings; loading and saving settings

    This objective does not include: persisting to database

  • Implement dependency properties.

    This objective may include but is not limited to: enabling data binding and animation, property metadata, property change callbacks

Stabilizing and Releasing a Solution (17%)

  • Implement a WPF test strategy.

    This objective may include but is not limited to: automation peer, UI automation, IntelliTrace

  • Debug XAML by using the WPF Visualizer.

    This objective may include but is not limited to: accessing the Visualizer, drilling down into the visual tree, viewing and changing properties

    This objective does not include: setting a breakpoint and stepping through code

  • Debug WPF issues by using PresentationTraceSources.

    This objective may include but is not limited to: animation, data binding, dependency properties

  • Configure a ClickOnce deployment.

    This objective may include but is not limited to: configuring the installation of a WinForms, WPF, or XBAP application by using ClickOnce technology; choosing appropriate settings to manage upgrades

  • Create and configure a Windows Installer project.

    This objective may include but is not limited to: configuring a setup project to add icons during setup, setting deployment project properties, configuring conditional installation based on operating system versions, setting appropriate Launch Conditions based on the .NET Framework version, adding custom actions to a setup project, adding error-handling code to a setup project

  • Configure deployment security settings.

    This objective may include but is not limited to: configuring and integrating UAC by using ClickOnce deployments; setting appropriate security permissions to deploy the application

以上所有資料來自微軟官網,網址為 :http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-511&locale=en-us#tab1

2010年3月8日 星期一

SharePoint 2010 Upgrade and Migration Resource(有關升級至 SharePoint 2010 參考資源)

目前 SharePoint 2010越來越夯,雖然還沒有推出正式版,只來到RC版,不過已經有很多企業現在已經蠢蠢欲動想要使用SharePoint2010,當然也有很多企業已經用了SharePoint2007,準備要升級到2010,在此亞當斯先整理了一些SharePoint 2010 Upgrade and Migration 的參考資源,都是依些很實用的文件或參考。

至於將來有沒有2007實際2010的升級案例,目前亞當斯也無法說得準,如果有機會的話,我會把升級的實戰過程記錄下來跟各位分享,以下就先方享給各位囉!

Upgrade and Migration Resource Center for Microsoft SharePoint Server 2010

Plan and prepare

Perform an in-place upgrade

Perform a database attach upgrade

Perform post-upgrade steps

Additional information

SharePoint 2010 Products administration by using Windows PowerShell

2010年3月5日 星期五

Visual Studio 2010 海報下載

今天收到微軟Dann提供有關 Visual Studio 2010 的相關訊息,有最新的評估指南,以及Visual Studio 2010 的海報唷,有興趣的朋友可以去下載來貼一下,亞當斯的座位前面柱子有貼了一張大大的Visual Studio 2010 海報,隨時提醒亞當斯新技術的技術海又來了,要再繼續隨波逐流一下~

1. Visual Studio 2010 Reviewer’s Guide (技術評估指南, 雖是英文版, 共55頁,但詳細介紹了 VS 2010 技術新功能, 產品規格及開發應用,非常實用的參考資料) - http://www.microsoft.com/downloads/details.aspx?FamilyID=3afc2930-24c3-4a97-9850-aab507edb043&displaylang=en

.NET Framework 4.0 海報 (貼在你的座位上超cool! 一定要下載,完整的 .NET Framework 4.0 Namespace & Class 一覽表,歡迎下載列印) - http://download.microsoft.com/download/E/6/A/E6A8A715-7695-493C-8CFA-8E0C23A4BE1D/098-115952-NETFX4-Poster.pdf

C# Lambda運算子的運用以及過程

這幾天在上C#基礎與法的介紹,後來介紹到Lambda的時候,發現教材中沒有好的範例以及內容可以提供說明,為了方便以後讓有興趣的朋友,可以參考,也避免到時候把程式碼忘了,所以先在這邊做一個範例程式碼的小筆記。

  1. 先建立一個Console應用程式
  2. 新增一個方法,並且宣告一個delegate

delegate int MyDelegate(int i, int j);

static int Add(int i, int j)
{
return i + j;
}

接著把使用Lambda的過程,逐一記錄,程式碼請直接參考以下內容:


          
//1.一般delegate用法
MyDelegate del = new MyDelegate(Add);
Console.WriteLine(del(10, 20));

//2.使用匿名方法設計delegate
MyDelegate del = delegate(int x, int y)
{
return x + y;
};

Console.WriteLine(del(10, 20));

//3.使用Lambda
MyDelegate delL = (i, j) =>
{
return i + j;
};
Console.WriteLine(delL(30, 40));

//4.泛型委派
Func delGD = (x, y) => { return x + y; };
Console.WriteLine(delGD(100,200));

2010年3月4日 星期四

VSTO Integrated Moss 2007 Design (VSTO 2005 整合MOSS 2007網站設計)

存取Moss網站時,瀏覽器只是其中一個常用的Client,另一個功能強大的前端程式其實是Officr,如:Word、Excel、Outlook等等,而Office軟體這個前端應用程式搭配Moss Server才是真正的完整整合,因為一般使用者使用Office時,並不需要另外做訓練,就可以駕輕就熟的使用Office來建立Moss網站,或是上傳文件資料,或是下載資料等等

然而,有時候當使用者使用這些Office時,假設有一些特殊需求無法達成,而必須特過客製化程式來達到目的時,那麼開發VSTO整合Moss就變成一個重要的議題了,在這裡亞當斯要介紹如何透過VSTO的應用程式來把Moss整合到應用程式中。

以下為開發的幾個主要簡易步驟,提供給各位參考:

1. 先執行Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System(CH).exe (網址為:http://www.microsoft.com/downloads/details.aspx?FamilyId=5E86CAB3-6FD6-4955-B979-E1676DB6B3CB&displaylang=en),安裝之後,VS2005就可以建立開發VSTO的專案範本。

2. 新增一個「Excel增益集」專案,叫做「ExcelAddIn」

3. 在專案按右鍵選擇加入參考,將Microsoft.SharePoint.dll加入參考

clip_image002[7]

4. 在「ExcelAddIn」專案按右鍵-->加入-->新增項目,選擇「使用者控制項」,並且命名為MOSSUserControl.cs

5. 在MOSSUserControl中設計畫面如下:

clip_image002

6. MOSSUserControl.cs中先匯入主要的命名空間:

using Microsoft.SharePoint;

using Excel = Microsoft.Office.Interop.Excel;

using Office = Microsoft.Office.Core;

7. 在buttonContact的click事件中撰寫程式,針對指定的MOSS網站取出其聯絡人清單中的資料

private void buttonContact_Click(object sender, EventArgs e)
{
    //取得MOSS網站中的聯絡人清單資料  
    SPWeb web = new SPSite(textBoxUrl.Text).OpenWeb();
    SPList list = (SPList)web.Lists["MOSS聯絡人"];
    foreach (SPListItem item in list.Items)
    {
        listBoxContact.Items.Add(item.DisplayName);
    }
}

8. 在buttonExcel的click事件中撰寫程式,將取得的聯絡人資料設定給Excel所選取的範圍(Range),程式碼如下

private void buttonExcel_Click(object sender, EventArgs e)
{
  Excel.Range RangeSelection =  (Excel.Range)Globals.ThisAddIn.Application.Selection;
   RangeSelection.Value2 = listBoxContact.SelectedItem.ToString();
}

9. 打開ThisAddIn專案下Excel資料夾中的ThisAddIn.cs檔,在ThisAddIn_Startup事件程序中,將使用者控制項透過CustomTaskPanes屬性加入Excel中。

MOSSUserControl myControl;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    … …
    myControl = new MOSSUserControl();
    this.CustomTaskPanes.Add(myControl, "Adams InsertData").Visible = true;
}

10. 建置完成,按下F5執行測試。

2010年3月3日 星期三

WSS 3.0 & Moss 2007 Web Service 架構簡介

WSS 3.0提供兩組主要的Web Service分別是 :

1. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ADMISAPI 下的admin.asmx,和 C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI 下的所有Web Service,這些Web Service相對到IIS中的_vti_bin;也就是說/_vti_bin/*.asmx = ..\12\ISAPI\*.asmx

clip_image002

而在\12\ISAPI\*.asmx 下的Web Service是最常運用在AP開發的,例如我們開發一個client要去叫用Moss網站的Excel Service的話,就可以在專案中加入Web參考 : http://domain/_vti_bin/excelservice.asmx

2. 另一個是Moss管理中心的 http://mossvr:44756 /_vti_adm/admin.asmx,主要有提供四個Method :

CreateSite : 用來建立Site

DeleteSite : 用來刪除Site

GetLanguages : 取得Site的語系

RefreshConfigCache : 重整設定的Cache

clip_image004

2010年3月2日 星期二

Design and Install Moss 2007 Feature (設計以及安裝 Moss 網站功能)

欲設計Moss的網站功能,必須了解Feature Framework的運作方式,在Moss中所有的Feature都是位於:C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES 並且以資料夾的型態分類著,因此建立Feature後,必須將設計好的Feature相關檔案,放到C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES這個路徑中,並且對應好適當的存取權限才行。

以下就來看看如何設計以及安裝啟動 Moss 中的Feature :

1. 打開 Visual Studio 2005 任一種專案,在專案中新增一個Xml檔,命名為「Feature.xml」,設定此Feature.xml內容如下:

<Feature Title="Simple ToolBar Button"
         Scope="Web"
         Id="{64E6A5C8-62FB-4d1a-A3F3-19912827DE26}"
         xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
        <ElementManifest Location="Elements.xml"/>
    </ElementManifests>
</Feature>

2. 在專案中新增一個Xml檔,命名為「Elements.xml」,設定此Elements.xml內容如下:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Title="簡單按鈕功能"               
                 RegistrationType="List"
                 RegistrationId="101"
                 Location="EditFormToolbar"
                 Id="Simple Toolbar">
        <UrlAction Url="/_layouts/SampleUrl.aspx"/>       
    </CustomAction>
</Elements>

3. 打開檔案總管,將路徑指到「C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES」,在這資料夾底下建立一個新的資料夾叫做「AdamsFeature」。

4. 將剛剛所新增的兩個Xml檔(Feature.xml、Elements.xml)複製到AdamsFeature下。

5. 新增一個ASPX的網頁應用程式叫做「SampleUrl.aspx」,內容簡單的展示一些訊息即可,將此SampleUrl.aspx放到路徑為「C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ LAYOUTS」的資料夾底下。

6. 建立命令 command註冊檔,新增一個檔案叫「InstallFeature.cmd」,編輯其內容如下:

SET SPDIR="c:\program files\common files\microsoft shared\web server extensions\12"
%SPDIR%\bin\stsadm -o installfeature -filename AdamsFeature\Feature.xml -force
%SPDIR%\bin\stsadm -o activatefeature -filename AdamsFeature\Feature.xml  -url http://center.beauty.corp
pause

7. 執行InstallFeature.cmd將AdamsFeature這個網站功能註冊到網站中,並且啟用其功能。

8. 打開瀏覽器,瀏覽網站http://center.beauty.corp 

9. 在這個網站中,點選「檢視所有網站內容」,點選「文件庫」,進入文件庫清單的畫面。

10. 在文件庫中新增一個「文件庫」後,針對此文件庫中的其中一個項目點選「編輯內容」,在編輯的畫面中可以看到多了一個自訂的按鈕,這表示AdamsFeature已經成功啟用。

11. 按下「簡單按鈕功能」會看到SampleUrl.aspx在瀏覽器中被執行。

12. 建立命令 command註冊檔,新增一個檔案叫「UnstallFeature.cmd」,編輯其內容如下:

SET SPDIR="c:\program files\common files\microsoft shared\web server extensions\12"
%SPDIR%\bin\stsadm -o deactivatefeature -filename AdamsFeature\Feature.xml -url http://center.beauty.corp/
%SPDIR%\bin\stsadm -o uninstallfeature -filename AdamsFeature\Feature.xml -force
Pause
IISReset

13. 執行UnstallFeature.cmd將AdamsFeature停用並移除。

2010年3月1日 星期一

List Template Id In Moss 2007

事件處理器在設定時,要去指定事件處理器所準備要套用到哪一個清單,那麼清單編號必須先清楚,才能做比較適當的運用,下列列表為系統預設所定義的清單編號:

List Template Id

List Template

100

Generic list

101

Document library

102

Survey

103

Links list

104

Announcements list

105

Contacts list

106

Events list

107

Tasks list

108

Discussion board

109

Picture library

110

Data sources

111

Site template gallery

113

Web Part gallery

114

List template gallery

115

XML Form library

120

Custom grid for a list

200

Meeting Series list

201

Meeting Agenda list

202

Meeting Attendees list

204

Meeting Decisions list

207

Meeting Objectives list

210

Meeting text box

211

Meeting Things To Bring list

212

Meeting Workspace Pages list

300

Portal Sites list

1100

Issue tracking

2002

Personal document library

2003

Private document library

2010年2月26日 星期五

SharePoint 2010 軟體開發人員技術預覽 3月份研討會

微軟在下個月(3月)有辦一場有關SharePoint 2010 軟體開發人員技術的介紹,是由曹祖聖講師所主講的一場研討會,基本上SharePoint 2010 的開發著實跟SharePoint 2007的開發上,有很多不一樣的要注意,就連SharePoint 2007開發的程式碼要運作在SharePoint 2010 都必須經過一定步驟的Upgrade,可見中間有不小的差異在。

曹祖聖在這場研討會的內容中,所列出的範圍蠻廣的,建議有興趣的開發SharePoint 2010 的朋友們,可以去報名聽聽看,報名網址在此:http://msdn.microsoft.com/zh-tw/ee869156.aspx

我先列大略的列一些他所會介紹的範圍在此(從報名網站整理過來的),給有興趣的朋友先參考一下,蠻建議先去聽一下的:

  • SharePoint 2010 簡介
  • 開發平台歷史與未來進程
  • 使用 Visual Studio 2010 開發 SharePoint 應用程式
  • SharePoint 物件模型
  • 設計與開發 SharePoint 介面
  • 清單與架構設計存取
  • 事件處理機制
  • LINQ to SharePoint
  • 工作流程
  • 服務架構
  • Business Connectivity Services (BCS)
  • 企業內容管理
  • 外部內容管理
  • SharePoint 搜尋
  • 商業智慧
  • 如何使用程式存取與設定 SharePoint 安全性
  • .NET 組件安全性與組件信任
  • 沙箱式 (Sandboxed) 解決方案
  • 應用程式安全性與 Claims-based 授權機制
  • 如何將 2007 版的程式碼升級至 2010 版
  • 應用程式生命週期管理
  • Feature Framework 與解決方案部署

看到以上這麼多的開發內容需要了解,我心裡想,真夭壽,這真不是人搞的產品,可以客製化的範圍也太廣了,其實每一個產品都一樣啦~要客製化,總是要下很多功夫的

哈哈~偏偏,唉~我看有關SharePoint 2010 開發課程規畫也差不多要開始進行了,喵~

2010年2月22日 星期一

.NET Call SAP/RFC by Visual Basic & VS2010

原本以為這輩子應該是沒什麼機會碰到這種非個人領域內的技術(SAP),孰不知資訊IT的世界果然是很小,想起以往年少輕狂,第一個工作是當個程式設計師,寫的是JSP網頁程式的部分,也有部分的JAVA開發,後來因為否些因素轉而投向比爾蓋茲的懷抱,開始寫起VB和ASP等微軟技術來,到了中菲以後,莫名奇妙又多少接觸到AS400和Oracle相關的技術,雖然沒有真正下去開發這AS400的系統,不過大致上皮毛也算是有摸到,正所謂沒吃過豬肉,也看過豬走路,到了恆逸算是個人領域技術的萬流歸宗,幾乎所有的時間就只專精在MS的技術上面。

直到前一陣子,因為答應幫忙朋友的忙,結果居然扯到的SAP,朋友要的只是很簡單的一句話,用.NET Call SAP/RFC 將資料取回在微軟相關的產品上。媽呀,這又是一個完全陌生的領域,我甚至連RFC是啥東西都不清楚(雖然後來問一下google大神就知道了),就好像一個武林高手,一腳踏入一個飄邈虛無的危險聳聳森林中,也只能憑著自身的保命技能努力的生活下來,身邊一切的環境尚待自我摸索。當然這樣說是有點誇張了點,有那種嚇死人不償命的feel,不過老實說,亞當斯以往從來沒有接觸過SAP,因此也就把這個幫忙,當作是一個自我的挑戰,嘗試看看是否可以搞點什麼東西出來。

話說,為了幫這個忙,花了我幾乎快兩個禮拜的時間,心疼阿~我的光陰~

開始進入正題吧,欲使用.NET技術與SAP溝通,有很多種方式,但是對於亞當斯來說,最簡單也是做快速的方式就是直接使用SAP的Client元件,來個直搗黃龍。因此要使用這種最簡單,也是最直接的方式來連結SAP的話,就必須有一些事先的開發環境必須要準備一下,以下亞當斯分為兩個部分來做說明,第一部分是開發環境的需求,第二部分是程式語言的撰寫。

首先先來談談開發環境的部分,我用的是Vs2010+VB

  1. 安裝SAP Client應用程式
  2. 就如同用Oracle Client 連到Oracle Server、As400 client連到As400 Server一樣,在欲開發的機器上,安裝SAP Client,並且設定一個可以連接到SAP Server的 Client Setting
    image
  3. 確定這個client可以順利連結到SAP,設定好相關的IP、ID、系統號碼和登入的帳號密碼等等。

接著打開Visual Studio開發工具,新增一個專案挑選適當的語言,開始撰寫程式:

  1. 先在專案中加入以下四個參考組件,分別為參考COM頁簽中的SAP BAPI Control、SAP Logon Control、SAP Table Factory、SAP Remote Function Call Control。
    image image image image
  2. 加入完成參考,VS專案中會將這些COM元件轉換為相對應的 .NET Interop Assembly放在Bin資料夾中
     image
  3. 在此以ASP.NET為例,新增一個網頁,開發寫程式,首先當然就是把這幾個.NET Interop Assembly相關的命名空間加入到應用程式中:
    Imports SAPBAPIControlLib
    Imports SAPLogonCtrl
    Imports SAPTableFactoryCtrl
    Imports SAPFunctionsOCX
  4. 接著撰寫相關登入SAP的功能,建立SAPLogonCtrl.SAPLogonControlClass物件,用來設定帳號密碼等相關的登入訊息,以便連結

    Dim login As New SAPLogonCtrl.SAPLogonControlClass()
    login.ApplicationServer = "192.168.10.10"
    login.Client = "888"
    login.Language = ""
    login.User = "Adams"
    login.Password = "P@ssw0rd"
    login.SystemNumber = Integer.Parse("00")
    Dim conn As SAPLogonCtrl.Connection = CType(login.NewConnection(), SAPLogonCtrl.Connection)
    If conn.Logon(0, True) Then
      ' 這邊撰寫連結SAP成功之後,.NET所要運作的事項
    Else
       lblMsg.Text = "Login Fail"
    End If

  5. 在來說說SAP/RFC的情境,在這個示範中:
    假設SAP/RFC 的模組名稱叫做:BAPISDORDER_GETDETAILEDLIST
    需要一個Structure,命名為:I_BAPI_VIEW
    以及一個Table當作參數,這個Table命名為:SALES_DOCUMENTS
    如此一來程式碼如下:
    image
  6. 當叫用SAP/RFC成功之後,接著就把所得的資料結果接收回來,假設這邊叫用了SAP/RFC之後,會有3個Table會傳回給.NET,那個就可以使用.NET的相關物件(如:DataTable…)去接收以及使用了
    image

如此一來,.NET Call SAP/RFC 的設計應該就完成了,到時候再依據不同的SAP/RFC所需要的參數,給予不同的數值即可達到動態叫用的功能,以上這幾個步驟和程式碼看起來雖然不多,但是老實說,可是把亞當斯搞得精疲力盡,原因一開始就說了,SAP是一個我從來沒有碰過的東西,又是必須在極短的時間內,也沒有其他人可以提供多餘的資源下,一步一腳印去測試出來,當然有問了一下google大神,但是得到的東西畢竟不多,例如:COM這些元件中的interface叫用的方式等等,都幾乎是一個method、一個method抓出來測試,說來真的是吐血。

不過,等到都測試完成,也搞懂一些有關整合SAP技術的時候,算是學習到一些新技術、新東西吧!當然也希望以上的經驗可以讓有需要的看倌有機會可以運用的上,這樣也算是亞當斯努力的心血中,有得到回報 ^_^y