360doc--waywin的文章 http://www.ahfyzs.com/rssperson/344.aspx 360doc (http://www.ahfyzs.com) zh-cn 360doc--個人圖書館 Things I Wish I Had Known http://www.ahfyzs.com/content/09/0217/02/344_2565606.shtml 2009/2/17 2:21:28
nobody can be an expert in all things technical. Find something that you enjoy doing (that statement alone should be a bullet point), and become an expert in that thing. You don''t have to specialize to the point that you''re a niche player, but you can limit your scope such that you can be known as an authority in your chosen area.
系統(tǒng)維修流程圖解 http://www.ahfyzs.com/content/08/1016/02/344_1771131.shtml 2008/10/16 2:37:46
系統(tǒng)維修流程圖解。
Don‘t redirect after setting a Session variable (or do it right) http://www.ahfyzs.com/content/08/0925/03/344_1673676.shtml 2008/9/25 3:00:19
A problem I see over and over again on the ASP.NET forums is the following:
In a login page, if the user and password have been validated, the page developer wants to redirect to the default page. To do this, he writes the following code:
Session["Login"] = true;
Response.Redirect("~/default.aspx");
Well, this doesn‘t work. Can you see why? Yes, it‘s because of the way Redi
Scripting Trace‘s for SQL 2005 http://www.ahfyzs.com/content/08/0620/02/344_1352345.shtml 2008/6/20 2:53:33
-- Set the eventsdeclare @on bitset @on = 1exec sp_trace_setevent @TraceID, 14, 1, @onexec sp_trace_setevent @TraceID, 14, 9, @onexec sp_trace_setevent @TraceID, 14, 6, @onexec sp_trace_setevent @TraceID, 14, 10, @onexec sp_trace_setevent @TraceID, 14, 14, @onexec sp_trace_setevent @TraceID, 14, 11, @onexec sp_trace_setevent @TraceID, 14, 12, @on.
Correlated Joins Using "Apply" http://www.ahfyzs.com/content/08/0618/02/344_1345343.shtml 2008/6/18 2:08:58
CreateDate,lvc.The apply statement comes in 2 flavors: CROSS APPLY and OUTER APPLY. CROSS APPLY will return All records in the outer query that have a matching record returned by the inner function\query (Similar to an Inner Join).OUTER APPLY will return all records in the outer query whether they have a matching record in the inner function\query or not (Similar to an Outer Join).
File download manager http://www.ahfyzs.com/content/08/0220/05/344_1055597.shtml 2008/2/20 5:34:13
import javax.swing.table.clearButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { actionClear();public static void main(String[] args) { DownloadManager manager = new DownloadManager();}}class Download extends Observable implements Runnable { private static final int MAX_BUFFER_SIZE = 1024;public Download(URL url) { this.url = url;
WCF之旅(13):創(chuàng)建基于MSMQ的Responsive Service http://www.ahfyzs.com/content/08/0216/09/344_1046749.shtml 2008/2/16 9:03:27
如果我們要把一個OrderResponseContext 對象插入到當前Operation Context的Outgoing Message Headers中,我們可以通過下面的代碼來實現(xiàn):OrderResponseContext context = new OrderResponseContext();MessageHeader<OrderResponseContext> header = new MessageHeader<OrderResponseContext>( context);OperationContext.Current.OutgoingMessageHeaders.Add(header.GetUntypedHeader("name", "namespace"));
WCF之旅(12):使用MSMQ進行Reliable Messaging http://www.ahfyzs.com/content/08/0216/09/344_1046748.shtml 2008/2/16 9:01:49
在MSMQ中,Message始終以O(shè)ne-way的方式進行發(fā)送,所以MSMQ具有天生的異步特性。在WCF中,MSMQ提供的數(shù)據(jù)傳輸功能被封裝在一個Binding中,提供WCF Endpoint之間、以及Endpoint和現(xiàn)有的基于MSMQ的Application進行通信的實現(xiàn)。在一般的情況下,MSMQ通過Message Queue Transaction實現(xiàn)對Transaction的原生的支持,借助Message Queue Transaction,可以把基于一個或多個Message Queue的相關(guān)操作納入同一個Transaction中。
WCF之旅 (11): 再談WCF的雙向通訊-基于Http的雙向通訊 V.S. 基于TCP的雙向通訊 http://www.ahfyzs.com/content/08/0209/08/344_1032502.shtml 2008/2/9 8:58:39
在Service Contract中設(shè)置了Callback Contract,Callback Contract定義在Interface Artech.DuplexWCF.Contract. ICallback中:using System;using System.Collections.Generic;using System.Text;using System.ServiceModel;namespace Artech.DuplexWCF.Contract{ [ServiceContract] public interface ICallback { [OperationContract(IsOneWay = true)] void DisplayResult(double result); }}
WCF之旅(10):如何在WCF進行Exception Handling http://www.ahfyzs.com/content/08/0209/08/344_1032498.shtml 2008/2/9 8:56:52
1. Service Contract- Artech.ExceptionHandling.Contract.><configuration> <system.serviceModel> <client> <endpoint address=http://localhost:8888/Calculator binding="basicHttpBinding" contract="Artech.ExceptionHandling.Contract.ICalculator" name="defualtEndpoint" /> </client> </system.
WCF之旅(9):如何在WCF中使用tcpTrace來進行Soap Trace http://www.ahfyzs.com/content/08/0209/08/344_1032496.shtml 2008/2/9 8:55:48
><configuration> <system.serviceModel> <services> <service name="Artech.ExceptionHandling.Service.CalculatorService"> <endpoint binding="wsHttpBinding" contract="Artech.ExceptionHandling.Contract.ICalculator" address="http://localhost:8888/Calculator" /> </serv
WCF中的異步調(diào)用 http://www.ahfyzs.com/content/08/0205/10/344_1027716.shtml 2008/2/5 10:38:08
WCF與Web Service不同的是,當我們定義了服務(wù)契約的操作時,不管是通過ChannelFactory創(chuàng)建服務(wù)代理對象,還是通過SvcUtil的默認方式生成服務(wù)代理對象,客戶端在調(diào)用這些代理對象時,都無法直接實現(xiàn)異步方式的調(diào)用。那么,客戶端究竟應(yīng)該如何執(zhí)行異步調(diào)用呢?}在調(diào)用異步方法時,由于對BeginTransferDocument()和EndTransferDocument()方法的調(diào)用可能會在不同的方法體中,因而我將服務(wù)代理對象定義為private字段。
WCF之旅(8):WCF中的Session和Instancing Management http://www.ahfyzs.com/content/08/0126/09/344_1005221.shtml 2008/1/26 9:51:13
WCF中的Session.如果通過以下的方式定義ServiceContract使之不支持Session,或者使用不支持Session的Binding(順便說一下,Session的支持是通過建立Sessionful Channel來實現(xiàn)的,但是并不是所有的Binding都支持Session,比如BasicHttpBinding就不支持Session),WCF實際上會為每個Service調(diào)用創(chuàng)建一個Service Instance,這實質(zhì)上就是PerCall的Instance Context Mode,但我為什么會說默認的是PerSession呢?
WCF之旅(7):面向服務(wù)架構(gòu)(SOA)和面向?qū)ο缶幊蹋∣OP)的結(jié)合——如何實現(xiàn)Service Contract的繼承 http://www.ahfyzs.com/content/08/0126/09/344_1005092.shtml 2008/1/26 9:18:13
IFullWhetherForecast>, Artech.><configuration> <system.serviceModel> <client> <endpoint address="http://localhost/Artech.InheritanceHierarchy/FullWhetherForecastService.svc" binding="wsHttpBinding" bindingConfiguration="" contract="Artech.InheritanceHierarchy.Client.IFullWhetherForecast&quo
WCF之旅(6):在Winform Application中調(diào)用Duplex Service出現(xiàn)TimeoutException的原因和解決方案 http://www.ahfyzs.com/content/08/0117/02/344_980163.shtml 2008/1/17 2:26:15
我們現(xiàn)在的Sample就是由兩個Request/Response MEP組成的Duplex MEP。從上圖中我們可以很清楚地看出真?zhèn)€Message Exchange過程,Client調(diào)用Duplex Calculator Service,Message先從Client傳遞到Service,Service執(zhí)行Add操作,得到運算結(jié)果之后,從當前的OperationContext獲得Callback對象,發(fā)送一個Callback 請求道Client(通過在Client注冊的Callback Channel:http://localhost:6666/myClient)。
WCF之旅(5):面向服務(wù)架構(gòu)(SOA)和面向?qū)ο缶幊蹋∣OP)的結(jié)合——如何實現(xiàn)Service Contract的重載(Overloading) http://www.ahfyzs.com/content/08/0103/02/344_942004.shtml 2008/1/3 2:10:05
Service{ [ServiceContract] public interface ICalculator { [OperationContract(Name = "AddWithTwoOperands")] double Add(double x, double y);OperationContractAttribute(Action="http://tempuri.org/ICalculator/AddWithThreeOperands", ReplyAction="http://tempuri.org/ICalculator/AddWithThreeOperandsResponse")] double AddWithThreeOperands(double x, d
WCF之旅(4):WCF中的序列化(Serialization)- http://www.ahfyzs.com/content/08/0101/05/344_938327.shtml 2008/1/1 5:49:22
Serialization 是通過Serializer來完成的,在WCF中,我們有3種不同的Serializer——DataContractSerializer(定義在System.RunTime.Serializtion namespace中)、XMLSerializer(定義在System.XML.Serialization namespace)和NetDataContractSerializer (定義在System.XML.Serialization namespace) 。private string _producingArea;所有運用了DataMemberAttribute的成員均被序列化到XML中——private string ProducingArea。
WCF之旅(3):在WCF中實現(xiàn)雙向通信(Bi-directional Communication) http://www.ahfyzs.com/content/08/0101/05/344_938325.shtml 2008/1/1 5:47:52
這個Project引用Artech.WCFService.Contract和Artech. Project WCFService.Service。這個Project引用Artech.WCFService.Contract、Artech.WCFService.Service和System.ServiceModel DLL。在這個例子中,當Artech.WCFService.Client調(diào)用Host在Artech.WCFService.Hosting中的DuplexCalculatorService(定義在 Artech.WCFService.Service中),Artech.WCFService.Client是Client,而Server端的執(zhí)行環(huán)境是Artech.WCFService.Hosting。
WCF之旅(2):Endpoint Overview http://www.ahfyzs.com/content/08/0101/05/344_938324.shtml 2008/1/1 5:46:48
然后他會根據(jù)定義在Service中的Endpoint定義為calculatorSerivceHost添加相應(yīng)的Endpoint。<client> <endpoint address="http://localhost/WCFService/SessionfulCalculatorService.svc" binding="wsHttpBinding" bindingConfiguration="" contract="Artech.WCFService.Contract.ISessionfulCalculator" ><headers> <role>admin</role>
WCF之旅(1):創(chuàng)建一個簡單的WCF程序 http://www.ahfyzs.com/content/08/0101/05/344_938323.shtml 2008/1/1 5:44:59
這個Project引用Artech.WCFService.Contract、Artech.WCFService.Service和System.ServiceModel DLL。//Create a Binding for Endpoint.<Endpoint Address="" Binding ="basicHttpBinding" contract="Artech.WCFService.Contract.ICalculator"></Endpoint><Endpoint Address="http://localhost:8080/WCFService/CalculatorService " Binding="basicHttpBinding" contra