Time of Update: 2018-12-07
n 類 類是物件導向程式設計中的核心概念,一個類通常表示一個對象的操作的集合定義方法: 修飾符 class 類名 { .... } 常用修飾符: public :訪問不受限制 protected :訪問僅限於包含類或該類的衍生類別 internal :訪問僅限於當前程式集(通常指同一命名空間下) protected
Time of Update: 2018-12-07
在這本書的最後一章提到演算法的陷阱的時候舉了幾個例子,記下兩個。1. 迴圈計數的覆蓋如果把1加到數值為255的位元組上,該位元組就會變為0。unsignedchari;for(i=0;i<256;i++){ cout<<"test"<<(int)i<<endl;}這就會出現一個死迴圈了,因為255之後再加一就又為0了。2. 數組和繼承的混用#include <iostream.h>classAverageJoe{public:
Time of Update: 2018-12-07
以前都沒怎麼注意兩者的區別(我甚至都不知道“&”),因為它們都是“與”運算子。我昨天看C#高編第三版的時候,才注意到這點,查了下MSDN,把區別貼出來,時時提醒自己。二元運算子 (&) 為整型和 bool 類型預定義了二進位 & 運算子。對於整型,& 計算運算元的按位“與”。對於 bool 運算元,& 計算運算元的邏輯“與”;也就是說,若且唯若兩個運算元均為 true 時,其結果才為 true。條件“與”運算子 (&&)
Time of Update: 2018-12-07
A、金山詞霸組件法在金山詞霸中2005中帶了一個XdictGrb.dll,添加引用廢話不多說了,還是把源碼放上using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Text;using System.Windows.Forms;using XDICTGRB;//金山詞霸組件namespace WindowsApplication1{
Time of Update: 2018-12-07
1.對DBNull的解釋: 該類用於指示不存在某個已知值(通常在資料庫應用程式中)。 在資料庫應用程式中,Null 物件是欄位的有效值。該類區分空值(Null 物件)和未初始化值(DBNull.Value 執行個體)。例如,表可以包含具有未初始化欄位的記錄。預設情況下,這些未初始化欄位具有 DBNull 值。 該類還可以用於在 COM Interop 中區分 VT_NULL 變數(與Null 物件關聯)和 VT_EMPTY
Time of Update: 2018-12-07
今天在CSDN上看到有人問某個類及其衍生類別的執行過程,並問輸出結果:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace ConsoleApplication1 { 6 class
Time of Update: 2018-12-07
//************************************************************////下面給出三個簡單的方法,後面兩個方法是擴充,估計有時用得著//************************************************************// /// <summary> /// 縮小圖片 /// </summary> /// <param
Time of Update: 2018-12-07
1、http://www.denisbauer.com/NETTools/FileDisassembler.aspx 下載FileDisassembler2、http://www.aisto.com/roeder/dotnet/ 下載Reflector
Time of Update: 2018-12-07
split 分隔字串比較常用,剛剛網上給看到這個,發現還不錯,很久沒更新偶的blog了,上來借用發發,以後說不定哪個時間忘記了還可以來瞧瞧。最近經常看到論壇中許多文章詢問如何使用split來分割字串,我這裡對split做一些簡單的總結,希望能夠對大家有所協助。下面介紹幾種方法:第一種方法:開啟vs.net建立一個控制台項目。然後在Main()方法下輸入下面的程式。 string s="abcdeabcdeabcde"; string[] sArray=s.Split('c'
Time of Update: 2018-12-07
1. MSDN上對Dictionary[key]="123"的描述.http://msdn.microsoft.com/zh-cn/library/9tee9ht2(v=VS.85).aspx此屬性提供使用以下 C# 文法訪問集合中特定元素的能力:myCollection[key](在 Visual Basic 中為 myCollection(key))。通過設定 Dictionary 中不存在的索引值,還可以使用 Item 屬性添加新元素。設定屬性值時,如果該鍵在 Dictionary
Time of Update: 2018-12-07
代碼如下:interface Interface1{ string name; void ttt();} 編譯會抱錯:Interfaces cannot contain fields.可見,c#介面裡不能有欄位field。那這種需求如何解決呢? 查一下msdn即知介面可以包含的成員如下:Methods Properties Indexers Events
Time of Update: 2018-12-07
public class TestTimer { //TimerCallback 委託,GlobalTimer_ToDo表示要執行的方法 public static Timer GlobalTimer = new Timer(new TimerCallback(GlobalTimer_ToDo), null, Timeout.Infinite, Timeout.Infinite); /*也可以直接定時
Time of Update: 2018-12-07
Delphi Data Type to C# Data Type Delphi DataType C#
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 using System; 2 using System.Text; 3 namespace ConsoleApplication2 4 { 5 class Class1 6 { 7 [STAThread] 8 static void Main(string[] args) 9 {
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 using System; 2 using System.Data; 3 using System.Data.SqlClient; 4 using System.Security; 5 using System.Security.Cryptography; 6 using System.IO; 7
Time of Update: 2018-12-07
SQLDMO.dll是隨SQL Server2000一起發布的。SQLDMO.dll自身是一個COM對象 SQLDMO(SQL Distributed Management Objects,SQL分散式管理物件)封裝 Microsoft SQL Server 2000 資料庫中的對象。SQL-DMO 允許用支援自動化或 COM 的語言編寫應用程式,以管理 SQL Server 安裝的所有部分。SQL-DMO 是 SQL Server 2000 中的 SQL Server
Time of Update: 2018-12-07
小小的一段strcpy函數,卻能看出不少的問題。在此作一下備忘: #include <iostream>#include <string>using namespace std;char* str_copy(char* dest,const char* src);int main(){ char* src="this is a test"; cout<<strlen(src)<<endl; //申請記憶體大小時,需要在源串的長度上
Time of Update: 2018-12-07
在我上一篇博文中曾提到了 SharePoint 中調用傳出電子郵件中的郵件伺服器及地址發送郵件 但是,裡面的方法只能用於發送普通電子郵件。如果要發起會議之類的特殊郵件的話,可以使用Outlook 自身的API。 建立項目後,為它添加.NET引用:“Microsoft.Office.Interop.Outlook"的引用,即可調用,需要注意的是,在添加的時候,注意一下OFFICE版本號碼。 在調用其API發起會議的過程中,遇到了一個問題:
Time of Update: 2018-12-07
近日到某公司面試,其中有道面試題是這樣的:要求只使用一個for迴圈輸出下面圖形:----如果可以使用2個for(即嵌套迴圈的話),那這題就很簡單了。但只能用一個for,這可把我想得,想到面試都結束了沒想出來。TMD,肯定是腦子短路了!!! 鬱悶的是,等到第2天重新一想,居然很快就想出來了,使用String對象,可以達成輸出重複字元的效果!!! 代碼貼在下面: 代碼 Code highlighting produced by Actipro CodeHighlighter (freeware)