Net記憶)

來源:互聯網
上載者:User
Get All Cultures in .Net摘要: This example shows how to get all culture names in the .NET Framework. Use static method CultureInfo.Get Cultures. To get associated specific culture use static method CultureInfo.Cre ateSpecificC...閱讀全文posted @ 2010-03-25 12:47 王德水 閱讀(95) | 評論 (0) 編輯svn執行個體摘要: 簽出 svn checkout URL path 簽出指定版本 svn checkout –r rev URL 簽出指定指定日期 svn checkout –r “{date}” URL 查看工作拷貝從哪裡來 svn info path 更新工作拷貝 svn update 添加檔案到工作拷貝 svn add path 設定檔案或者目錄的屬性 svn ...閱讀全文posted @ 2010-03-21 11:28 王德水 閱讀(458) | 評論 (1) 編輯Subversion命令匯總摘要: svn 命令共同的選項 --targets list 讀取list並將其解釋為一個將要操作的參數列表 --non-recurisive, –N 只操作單個目錄,不處理子目錄 --verbose, –v 列印額外的資訊 --quiet, –q 列印的資訊儘可能少 --username, name 指定在串連授權時使用的使用者名稱 --password, pawd 指定...閱讀全文posted @ 2010-03-21 10:15 王德水 閱讀(646) | 評論 (0) 編輯Regex:為站內連結加上網域名稱摘要: 1、測試文本 <a href='http://search/a.aspx'>home</a><a href='/aab/bb'>hello</a><a href='http://www.sohu.com'>sohu</a><p>sdfsf</p><a href="/aab/bb&quo...閱讀全文posted @ 2010-01-24 11:42 王德水 閱讀(126) | 評論 (0) 編輯設計模式:Factory 方法摘要: 在簡單原廠模式中,將執行個體化對象的工作延遲到了專門負責建立對象的工廠類中,可以根據我們預知動態建立產品類。但是,一旦客戶的變化超過預知我們就必須修 改我們的原始碼(FoodShop工廠)了。 switch (foodName){ case "Sugar": return new Sugar(); case "Bread": return new Bread()...閱讀全文posted @ 2009-11-26 14:16 王德水 閱讀(96) | 評論 (0) 編輯設計模式:簡單工廠摘要:          簡單工廠的作用是執行個體化對象,而不需要客戶瞭解這個對象屬於哪個具體的子類。          簡單工廠執行個體化的類具有相同的介面,在類有限並且基本不需要擴充時,可以使用簡單工廠。例如,資料庫連接對象,常用的資料庫類類可以預知...閱讀全文posted @ 2009-11-26 13:47 王德水 閱讀(93) | 評論 (0) 編輯設計模式:單件模式摘要: Singleton模式要求一個類有且僅有一個執行個體,並且提供了一個全域的訪問點。 1. 單線程時方法 public sealed class Singlton{ static Singlton instance = null; Singlton() { } public static Singlton Instance { get { if (instance == null) { return...閱讀全文posted @ 2009-11-26 11:43 王德水 閱讀(121) | 評論 (0) 編輯.NET面試題摘要: 1、.NET中所有內建類型的基類是什嗎? System.Object 2、System.Object中包含哪些方法,哪些是虛方法? System.ValueType已經實現了類型內容的比較,所以所有實值型別的引用比較將返回false. 3、實值型別和參考型別的區別? A.賦值的區別 B.記憶體配置的區別 4、裝箱和拆箱的基本概念? 裝箱和拆箱本質上是實值型別轉換到System.Object時...閱讀全文posted @ 2009-11-06 23:06 王德水 閱讀(72) | 評論 (0) 編輯.NET多線程小記(6):線程同步摘要: 同步塊的機制: 在.NET被載入時初始化同步塊數組 每一個被分配在堆上的對象都會包含兩個額外的欄位,其中一個儲存類型指標,而另外一個就是同步塊索引,初始時被賦值為-1. 當一個線程試圖使用該對象進入同步時,會檢查該對象的同步索引。如果索引為負數,則會在同步塊數組中尋找或者建立一個同步塊,並且把同步塊的索引值寫入該 對象的同步索引中。如果該對象的同步索引不為負值,則找到該對象的同步塊並且檢查是否有其他...閱讀全文posted @ 2009-11-06 15:15 王德水 閱讀(115) | 評論 (0) 編輯.NET多線程小記(7):進程同步Mutex摘要: 互斥體是跨進程的同步,效率非常低 using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading;using System.Diagnostics;namespace MultiThreadTest{ class Pro...閱讀全文posted @ 2009-11-06 15:15 王德水 閱讀(187) | 評論 (0) 編輯.NET多線程小記(5):線程獨享資料TLS摘要: 執行緒區域儲存(Thread Local Storage TLS) 在.NET程式中,靜態變數是全域(整個應用程式定義域)可見的資料,一個普通的靜態變數對於應用程式定義域內的所有線程都是可見並且是可訪問的。 TLS是指儲存線上程環境塊內的一個結構,用來存放該線程內獨享的資料。進程內的線程不能訪問不屬於自己的TLS,這就保證了TLS內的資料線上程內是全 局共用的,而對於線程外卻是不可見的。   ...閱讀全文posted @ 2009-11-06 15:13 王德水 閱讀(112) | 評論 (0) 編輯.NET多線程小記(4):線程池摘要: .NET線程池 線程池中啟動並執行線程都為後台線程,線程的IsBackground屬性都會被設為true.所謂的後台線程是指這些線程的運行不會阻礙應用程式的結束。相 反的,應用程式必須等待所有前台線程結束後才能退出。 樣本 using System;using System.Collections.Generic;using System.Linq;using System.Text;using ...閱讀全文posted @ 2009-11-06 15:01 王德水 閱讀(102) | 評論 (0) 編輯.NET多線程小記(3):線程的狀態摘要: 線程的狀態 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace MultiThreadTest{ class Program { static void Main(string[] args) { Console.Wri...閱讀全文posted @ 2009-11-06 14:57 王德水 閱讀(92) | 評論 (0) 編輯.NET多線程小記(2):多線程樣本摘要: 多線程樣本: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace MultiThreadTest{ class Program { static void Main(string[] args) { Console.Wri...閱讀全文posted @ 2009-11-06 14:53 王德水 閱讀(85) | 評論 (0) 編輯.NET多線程小記(1):進程、線程、纖程摘要: 進程 進程代表了作業系統上運行著的一個應用程式。進程擁有自己的程式塊,擁有獨佔的資源和資料,並且可被作業系統來調度。即使同一個應用程式,當被強制多次啟 動時,也會被安裝到不通的進程之中單獨運行。 線程 線程有時候也被稱為微進程或者輕量級進程,它的概念和進程十分相似,是一個可以調度的單元,並且維護自己的堆棧和上下文環境。線程是附屬於進程的,一個進 程可以包含一個或者多個線程,並且同一個進程內的多個線...閱讀全文posted @ 2009-11-06 14:48 王德水 閱讀(142) | 評論 (0) 編輯[Tips]:實值型別和參考型別的一個例子摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { string[] a = { "a", "b", "c", "d" }; ...閱讀全文posted @ 2009-07-22 15:56 王德水 閱讀(113) | 評論 (0) 編輯[tips]: 多線程 ManualResetEvent摘要: WaitHandle用於實現對共用資源的獨佔訪問,AutoResetEvent和ManualResetEvent都繼承自它。 WaitHandle.WaitOne方法將阻塞當前線程,直到WaitHandle收到訊號。但有時候,我們需要非阻塞的方式測試WaitHandle 狀態。 public virtual bool WaitOne(int millisecondsTimeout)可以指定等待的...閱讀全文posted @ 2009-05-21 14:23 王德水 閱讀(125) | 評論 (0) 編輯[Tips]:Read value from Resource file in C#摘要: 1: //Namespace reference 2: using System; 3: using System.Resources; 4:  5:  6: #region ReadResourceFile 7: /// <summary> 8: /// method for reading a value from a resource file 9: /// ...閱讀全文posted @ 2009-05-18 16:18 王德水 閱讀(197) | 評論 (0) 編輯Get countries from system摘要: 1: using System; 2: using System.Collections.Generic; 3: using System.Linq; 4: using System.Text; 5: using System.Globalization; 6: using System.IO; 7: 8: namespace CultureInformation 9: { 10: class ...閱讀全文posted @ 2009-05-08 16:02 王德水 閱讀(33) | 評論 (0) 編輯程式碼片段:ASCII to Unicode摘要: 1: private string ConvertAsciiToUnicode(string theAsciiString) 2: { 3: // Create two different encodings. 4: Encoding aAsciiEncoding = Encoding.ASCII; 5: Encoding aUnicodeEncoding = Encoding.Unicode;...閱讀全文posted @ 2009-04-17 10:44 王德水 閱讀(107) | 評論 (1) 編輯MSIL(1): Hello World摘要: 1. 用記事本編寫如下代碼.assembly HelloWorld{}.assembly extern mscorlib{}.class HelloWorld extends [mscorlib]System.Object{ .method public static void HelloWorld() { .maxstack 1 ldstr "Hello World" call void [...閱讀全文posted @ 2009-03-09 22:14 王德水 閱讀(102) | 評論 (0) 編輯MSIL(0):簡介摘要: Microsoft Intermediate Language (MSIL)微軟中繼語言 MSIL是將.NET代碼轉化為機器語言的一個中間過程。它是一種介於進階語言和基於Intel的組合語言的偽組合語言。當使用者編譯一個.NET程式時, 編譯器將原始碼翻譯成一組可以有效地轉換為機器碼且獨立於CPU的指令。當執行這些指令時,即時(JIT)編譯器將它們轉化為CPU特定的代碼。由於公 共語言運行庫支援多種...閱讀全文posted @ 2009-03-04 23:06 王德水 閱讀(142) | 評論 (0) 編輯C#拾遺系列(9):繼承、介面、擴充方法、部分類別、類操作、Ref and Out、可空類型posted @ 2008-06-19 15:07 王德水 閱讀(285) | 評論 (1) 編輯C#拾遺系列(8):異常posted @ 2008-06-19 11:02 王德水 閱讀(101) | 評論 (0) 編輯C#拾遺系列(7):自訂屬性posted @ 2008-06-18 14:52 王德水 閱讀(174) | 評論 (0) 編輯C#拾遺系列(6):迭代器posted @ 2008-06-14 23:03 王德水 閱讀(154) | 評論 (0) 編輯C#拾遺系列(5):泛型委派posted @ 2008-06-14 17:25 王德水 閱讀(149) | 評論 (0) 編輯C#拾遺系列(4):索引器posted @ 2008-06-11 15:30 王德水 閱讀(200) | 評論 (0) 編輯C#拾遺系列(3):建構函式posted @ 2008-06-11 15:19 王德水 閱讀(145) | 評論 (0) 編輯C#拾遺系列(2):屬性posted @ 2008-06-11 14:54 王德水 閱讀(107) | 評論 (0) 編輯C#拾遺系列(1):委託WCF和IIS宿主的ASP.NET 共用工作階段摘要: 1. 建立WCF工程 2. 在web工程裡建一個.svc檔案3. 修改web.config主要是添加<serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment> ,還有allwoCookies一定要設為true.閱讀全文posted @ 2010-05-18 14:40 王德水 閱讀(210) | 評論 (0) 編輯IIS宿主wcf時的錯誤解決摘要: 今天用IIS宿主wcf服務時,一直報如下錯誤,折騰了近兩個小時,才知道web.config裡配的endpoint和windows service裡配的endpoint相同,停止windows servcie恢複正常。   XML Parsing Error: no element found Location: http://10.10.50.127/CalendarService/...閱讀全文posted @ 2010-04-08 14:47 王德水 閱讀(142) | 評論 (0) 編輯WSDL 1.1 規範摘要: Web Services Description Language (WSDL) 1.1 W3C Note 15 March 2001 This version: http://www.w3.org/TR/2001/NOTE-wsdl-20010315 Latest version: http://www.w3.org/TR/wsdl Authors (alphabetically): Erik...閱讀全文posted @ 2009-12-14 13:49 王德水 閱讀(148) | 評論 (0) 編輯調用web service逾時摘要: SOLUTION:==========- We need to increase the timeout setting of the web service proxy class before making the call to the web service.Example: localhost.Service1 ws = new localhost.Service1();ws.Timeo...閱讀全文posted @ 2009-08-26 11:43 王德水 閱讀(286) | 評論 (0) 編輯The Operation has timeout摘要: public partial class SampleDataContext : System.Data.Linq.DataContext{partial void OnCreated(){this.CommandTimeout = 8000;}}然後,調用時繼續報Operation has time out.晚上回家,吃完飯就開始排查,不斷設定下面的那些參數,測試,仍然報Operation ha...閱讀全文posted @ 2009-08-24 23:13 王德水 閱讀(8) | 評論 (0) 編輯[Tips]:SQL server 2005 Create Assembly Failed摘要: 今天建立SQL server2005 程式集時,提示許可權失敗,我是sa許可權。最後通過 添加如下這句才得以通過 1: ALTER DATABASE [TestDB] SET TRUSTWORTHY ON完整代碼如下: 1: USE [TestDB] 2: GO 3: IF EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'G...閱讀全文posted @ 2009-05-14 16:45 王德水 閱讀(189) | 評論 (0) 編輯WCF 小提示:Contract-First時的注意事項摘要: 在Contract-First的模式下 我們使用svcutil.exe *.wsdl *.xsd /mc /l:cs 組建代理程式類時。 在設計Schema時需要注意以下幾點 1. 不能用屬性 2. 不能使用extision,如下 1: <xs:complexContent> 2: <xs:extension base="tns:RequestBase"&...閱讀全文posted @ 2009-04-30 12:05 王德水 閱讀(91) | 評論 (0) 編輯使用Fiddler測試WCF摘要: 之前自己為測試人員寫了個工具來測試WCF,但是當時是硬式編碼,雖然使用方面簡單,但重用性不高,沒想到連續做幾個這樣的項目。於是發現原來用 Fiddler也可以。如果我們用的是basicHttpBinding,那麼我們可以使用Fiddler來測試1. 開啟Fiddler,選中Request Builder2. 輸入的Content-Type3,輸入正確的SOAPAction4.選擇POST,輸入服...閱讀全文posted @ 2009-04-27 14:47 王德水 閱讀(204) | 評論 (0) 編輯WCF跟蹤調試摘要: WCF提供了兩個工具可以跟蹤WCF的調用過程,我主要是用來跟蹤傳輸的xml是否符合我定義的schema。這兩個工具是:工具路 徑:C:\Program Files\Microsoft SDKs\Windows\v6.0A\binSvcConfigEditor:微軟提供的用來輔助編輯WCF設定檔的工具 SvcTraceViewer:微軟提供的用來查看WCF的Trace Log的工具。跟蹤配置啟動Svc...閱讀全文posted @ 2009-03-16 11:56 王德水 閱讀(378) | 評論 (0) 編輯WCF步步為營(五):資料契約posted @ 2008-07-03 17:11 王德水 閱讀(233) | 評論 (0) 編輯WCF步步為營(四):用戶端使用代理類使用服務posted @ 2008-07-03 13:13 王德水 閱讀(513) | 評論 (1) 編輯WCF步步為營(三):使用設定檔改變使用服務的方式posted @ 2008-07-03 10:57 王德水 閱讀(202) | 評論 (0) 編輯WCF步步為營(二):使用設定檔改變發布服務的方式posted @ 2008-07-02 17:57 王德水 閱讀(174) | 評論 (0) 編輯WCF步步為營(一):簡單樣本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.