Time of Update: 2016-06-29
標籤:mysql c linu 準備: 系統: ubuntu12.04 工具: gcc,mysql,libmysqlclient-dev測試代碼(檔案名稱:con_mysql.c):#include<mysql/mysql.h&
Time of Update: 2016-06-30
標籤: string ss = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Random a = new Random();
Time of Update: 2016-06-30
標籤: 在這一節練習中,我們向大家介紹一下C#中的另一種重要的迴圈語句,for迴圈。 for(運算式1;運算式2;運算式3) { 迴圈體 } 運算式1:一般為賦值運算式,給控制變數賦初值; 運算式2:邏輯運算式,迴圈控制條件;當條件為真時,迴圈執行迴圈體中的語句。 運算式3:一般為賦值運算式,給控制變數增量或減量。 這樣看起來是不是挺抽象的。通過實際的例子,你會非常容易理解for迴圈。 你建立一個
Time of Update: 2016-06-30
標籤: 使用word模板匯出word文檔,首先需要在word模板中插入書籤:根據建立的書籤名和位置,將需要寫入的內容插入到word檔案中。需要引用 Microsoft.Office.Interop.Word;在添加引用-程式集中搜尋可以找到。 using System;using System.Collections.Generic;using System.IO;using System.Linq;using
Time of Update: 2016-06-28
標籤: int[] ss = new int[6]; Random s = new Random();
Time of Update: 2016-06-29
標籤:c#只能繼承一個基類和多個介面(0+)父類:Human;class Human { public virtual Move() { Console.WriteLine("Human的虛方法"); } public viod Play() { Console.WriteLine("Human的Play方法"); } }子類:Chinese;class Chinese:Human { public override void
Time of Update: 2016-06-28
標籤: SmtpClient smtpServer = new SmtpClient("smtp.163.com"); smtpServer.Port = 25; smtpServer.Credentials = new System.Net.NetworkCredential("feiyang", "1234"); smtpServer.EnableSsl = true;
Time of Update: 2016-07-01
標籤:最近在搞一個小東東,用到了泛型的處理,用到了對泛型的執行個體化問題。下面來講講對泛型的執行個體化,以代碼為例,如:public class A{}public class B<T>{ public static T Get() { //在這一塊如何執行個體化T這個對象呢?如果用default(T)這個是不行的。只能做一個null值處理。
Time of Update: 2016-06-27
標籤: System.Reflection.Assembly ass = System.Reflection.Assembly.Load("項目名稱或者DLL"); //System.Threading.Tasks Type type = ass.GetType("實體的完整名稱不帶.cs"); var entity = Activator.CreateInstance(type); /
Time of Update: 2016-06-27
標籤: 在C#編程中,我們經常需要處理這些情況。 1. 某種條件為真時,程式這樣處理;當某種條件為假時,程式那樣處理。 2. 當某種條件為真時,程式一直這樣處理;這裡的條件,在C#中就是邏輯運算。接下來我就和大家聊聊C#中關於邏輯運算的一些基本概念。 比較子 比較子,顧名思議就是用來作比較,比較子有>,<,>=,<=,==,!=共六個,注意>=是一個運算子,同理,&
Time of Update: 2016-06-28
標籤: C# 中在映像上畫框,通過滑鼠來實現主要有四個訊息響應函數MouseDown, MouseMove, MouseUp, Paint重繪函數實現。當滑鼠鍵按下時開始畫框,滑鼠鍵抬起時畫框結束。Point start; //畫框的起始點Point end,//畫框的結束點bool blnDraw;//判斷是否繪製Rectangel rect; 滑鼠按下響應private void PictureBox1_MouseDown(object sender,
Time of Update: 2016-06-30
標籤:不廢話直接上代碼 主要注意是 紅色代碼部分 Aspose.Cells.TxtLoadOptions lo = new TxtLoadOptions(); lo.Encoding =
Time of Update: 2016-06-30
標籤:http://www.cnblogs.com/qingliuyu/p/3835858.html以下是C#下的日期與unix時間戳記的相互轉換:/// <summary>/// 日期轉換成unix時間戳記/// </summary>/// <param name="dateTime"></param>/// <returns></returns>public static long
Time of Update: 2016-06-30
標籤:Program.cs中代碼如下:using System;using System.Collections.Generic;using System.Windows.Forms;namespace test1{ public static class Program { public static Main main; public static Main GetMain() { if (main == null
Time of Update: 2016-07-02
標籤:
Time of Update: 2016-07-01
標籤:[添加指令碼(Move)]//該指令碼掛在img的父物體上using UnityEngine;using System.Collections;using UnityEngine.UI;//定義枚舉public enum Tools{ 空, 塞尺}public class Move : MonoBehaviour { //放置img的父物體(表單,如所示) public GameObject LittleWin1; public
Time of Update: 2016-07-01
標籤:獲得資源的介面 /*NSString *img1 = [[NSBundle mainBundle] pathForResource:@"ad_1" ofType:@"png"]; NSString *img2 = [[NSBundle mainBundle] pathForResource:@"ad_1"
Time of Update: 2016-06-29
標籤:安裝Mongodb node js module, 發現標題上的錯誤。主要原因是mongodb依賴的bson需要c++編譯。Node-gyp 被用來編譯native的模組,而Node-gyp依賴於pathon 和C++編譯器來做編譯。所以解決步驟如下npm install -g node-gyp git clone https://github.com/mongodb/js-bson.gitcd js-bson npm install node-gyp
Time of Update: 2016-06-28
標籤:Cocoa和Object-c是蘋果公司OS
Time of Update: 2016-06-28
標籤:在I2C裝置讀取,必須是在同一個周期內。一個例子,可以同時讀出兩個值int read_register_double_value(int reg_addr, unsigned char *value_h, unsigned char *value_l){struct i2c_rdwr_ioctrl_data io_data = {0};struct i2c_msg msg[2] = {{0}};unsigned char data = 0;unsigned char out[2] = {0