Time of Update: 2018-12-06
template< class C >class TComList : public std::list< C >{public: typedef typename std::list<C>::iterator TComIterator; TComList& operator += ( const TComList& rcTComList) { if( ! rcTComList.empty() ) {
Time of Update: 2018-12-06
客戶帶來一個虛擬機器,結果C盤分了126GB。如所示:用CSUpload上傳,會出現“TheVHDs logical size of 130048MB exceeds the system maximum of 66560MB”.錯誤。解決辦法:收縮C盤空間具體步驟: 1. Shut down theVM.2. Copy VHD fileto your machine from where you will be performing
Time of Update: 2018-12-06
// program.cs// PerfTimer 及 測試程式CodeCode highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-06
昨天看三層架構 (具體沒怎麼弄懂) 發現一般有一頁代碼專門使用者存放欄位的 而且都用用屬性封裝..令我詫異的是 很多欄位屬性都存在 get{}和set{} 和普通的變數沒什麼區別(可讀可寫) 我就感覺屬性就是給欄位一個多的選擇方式,有的欄位是不允許更改的.. 部落格園一查,還真的漲見識了剛寫程式時總覺得一個欄位就能滿足要求,何必要使用定義起來麻煩的屬性 要get、set的去定義,代碼量還大,真不知道他們的區別和優點 例:public class myclass { public
Time of Update: 2018-12-06
轉自 http://www.cnblogs.com/zxz414644665/archive/2010/08/06/1794430.htmlC#中對Excel的操作大概有3、4種,今天就貼上其中的一種,呵呵,以備後用。代碼/////////////////////////////////////////////////////////////////////////////Purpose:Excel檔案匯入匯出,需引用Microsoft Excel 11.0 Object
Time of Update: 2018-12-06
C# codeSqlCommand sqlCmd = new SqlCommand();sqlCmd.Connection = sqlCnn;sqlCmd.Transaction = sqlCnn.BeginTransaction(); //完成交易處理的前期準備工作try{//將使用者註冊的資料寫入資料庫string sqlCmd1 = "insert into User_Login (user_id,user_pwd) values('" + User_ID + "','" +
Time of Update: 2018-12-06
本文介紹利用Linux下的C語言Socket函數建立TCP串連,相容C++。 利用TCP串連,可以進行HTTP、FTP等常見協議的資訊傳輸,是Linux網路編程的重要部分。需要引用的標頭檔進行網路編程,通常需要引用如下標頭檔 #include <sys/socket.h>#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>#include
Time of Update: 2018-12-06
最近開發一個程式,需要從c++端啟動一個c#開發的程式,並傳遞參數。具體做法是:在c++端調用CreateProcess()來啟動c#端,並傳遞相關參數,而在c#端通過Main(string[] args)中的args來接收命令列參數。C++發送端代碼:int main(int argc, char* argv[]){ char *fileName="c:\csharp.exe"; char *params="參數1 參數2 參數3";//傳遞三個參數
Time of Update: 2018-12-06
文章目錄 水溶效果(Aqua effects)Office2007 效果(Office2007 effects)一些設計目標快速指南 轉自:http://www.cnblogs.com/peterzb/archive/2009/06/21/1507880.html 1. 仿office 2007的Ribbon風格面板(該控制項模仿office 2007的Ribbon風格,顯示操作面板。)2.
Time of Update: 2018-12-06
1. 以下三條輸出語句分別輸出什嗎?Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->char str1[] = "abc";char str2[] = "abc";const char str3[] = "abc"; const char str4[] = "abc"; const char* str5 = "abc";const char*
Time of Update: 2018-12-06
現有文字檔“test.txt”(使用vc儲存的,具體格式編碼未知),只有2行字串,如所示: 圖1 其行資料是按照一定格式排列的,前6個位元組表示是人名(字串),後2個位元組表示年齡(整形值)。例如第一行“熊選文28”,表示熊選文的年齡是28歲。注意,第二行其中的”?”不是中文的問號,也不是英文的問號,只是Windows系統沒有對應字元,才顯示? 。如,該“?”對應的兩個位元組:C6 32。 圖2
Time of Update: 2018-12-06
C# 自訂使用者控制項xiongxuanwen 上篇:控制項製作 本例是製作一個簡單的自訂控制項,然後用一個簡單的測試程式,對於初學者來說,本例子比較簡單,只能起到拋石引玉的效果。我也是在學習當中,今後會將自己所學的逐步寫出來和大家交流共用。 第一步:建立一個控制項陳列庫項目:myControl 第二步:從工具箱裡面拖動1個PictureBox、1個Button、6個Lable控制項到使用者介面上,布局如下:
Time of Update: 2018-12-06
1. 擷取輸入的第一個程式 1 #include <iostream> 2 using namespace std; 3 4 int main(){ 5 6 char str[15]; 7 cin>>str; 8 cout<<str<<endl; 9 10 system("pause");11 return 0;12 }上面的程式可以擷取使用者的輸入,但是如果使用者輸入如下字串:abcd
Time of Update: 2018-12-06
項目是在wince平台下做的,但是解析過程和代碼卻別不大,貼出代碼,留做備份。// TestIXML.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <windows.h>#include <comutil.h>#include <stdlib.h>#include <stdio.h>#include <MsXml2
Time of Update: 2018-12-06
server端: #include <WINSOCK2.H>#include <stdio.h>#pragma comment(lib,"ws2_32.lib")void main(){ //建立通訊端 WORD myVersionRequest; WSADATA wsaData; myVersionRequest=MAKEWORD(1,1); int err; err=WSAStartup(myVersionRequest,&wsaData); if
Time of Update: 2018-12-06
//以單詞為單位對字串進行翻轉,先按照字母進行翻轉,然後按照單詞進行翻轉 string str1 = "12345 67890"; string str2 = ""; string str3 = ""; for (int o = str1.Length - 1; o >= 0; o--) str2 += str1[o];//按字母翻轉
Time of Update: 2018-12-06
//////////////////////////////////////////////////////////////////////////// UDPServer.cpp#include <stdio.h>#include <WINSOCK2.H>#pragma comment(lib,"WS2_32.lib")#define BUF_SIZE64int main(void){WSADATAwsd;SOCKETs;intnRet;//
Time of Update: 2018-12-06
我們知道,用C++開發的時候,用來做基類的類的解構函式一般都是虛函數。可是,為什麼要這樣做呢?下面用一個小例子來說明: 有下面的兩個類:class ClxBase{public: ClxBase() {}; virtual ~ClxBase() {}; virtual void DoSomething() { cout << "Do something in class ClxBase!" << endl; };};class
Time of Update: 2018-12-06
實現序列化的類必須滿足下列條件:1. 該類需要從CObject類派生(可以是間接派生);2. 在類中中進行DECLARE_SERIAL宏定義;3. 類存在有預設的建構函式;4. 類中實現了Serialize()函數,並且在其中調用基類的序列化函數;5. 使用IMPLEMENT_SERIAL宏指明類名及版本號碼;C/C++ code.hstruct Node { int index; std::vector <int> num; } class
Time of Update: 2018-12-06
單例模式是為了確保一個類中只有一個執行個體被建立,並提供對該執行個體的全域訪問指標廢話不說,上代碼 Singletonpublic sealed class Signton {public static Signton singn = null;private static readonly object padlock = new object();private Signton() { }public static Signton Instance