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
標籤:1. C#裡使用Find函數尋找物體時要用 GameObject:GameObject.Find("Canvas/Text").GetComponent<Text>().text="Score";2. 用Instantiate初始化物體時要用 as Transform 轉換類型(對於 Transform
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-07-01
標籤:最近在搞一個小東東,用到了泛型的處理,用到了對泛型的執行個體化問題。下面來講講對泛型的執行個體化,以代碼為例,如:public class A{}public class B<T>{ public static T Get() { //在這一塊如何執行個體化T這個對象呢?如果用default(T)這個是不行的。只能做一個null值處理。
Time of Update: 2016-07-01
標籤://定義類public class MyClass{public int Property1 { get; set; }}static void Main(){MyClass tmp_Class = new MyClass();tmp_Class.Property1 = 2;Type type = tmp_Class.GetType(); //擷取類型System.Reflection.PropertyInfo propertyInfo =
Time of Update: 2016-06-27
標籤:在vs中進行C#編程時:(1)輸入svm然後按Tap鍵會產生main函數;(2)Ctrl +k+s 三個鍵一起按,會調出程式碼片段(當需要對程式中代碼加region的話,全部選中代碼,然後按以上三個快速鍵,調出region,會自動包括選中代碼);(3)Home鍵和End鍵:Home鍵會使游標移到當前程式碼的開頭,而End會使游標移到當前程式碼的結尾;這兩個鍵在對長程式碼操作的時候用的比較多;(4)Shift鍵的使用
Time of Update: 2016-06-27
標籤: #region Protected Property protected Regex rLetters { get { return new Regex("[a-zA-Z]{1,}"); } } /// <summary> /// 驗證數字 /// </summary> protected Regex rDigit { get { return new Regex("[0-9]{1,}"); }
Time of Update: 2016-06-27
標籤:0、常用方法Navigate(string urlString):瀏覽urlString表示的網址Navigate(System.Uri url):瀏覽url表示的網址Navigate(string urlString, string targetFrameName, byte[] postData, string additionalHeaders):
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-27
標籤: public HttpResponseMessage UpdateModule(Mode mode) { var response = Process.Instance.ExecuteString(() => { var count = DbHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(),
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-07-02
標籤:
Time of Update: 2016-07-02
標籤: 對C/C++程式員來說,管理和使用虛擬儲存空間可能是個困難的, 容易出錯的任務。與儲存空間有關的錯誤屬於那些令人驚恐的錯誤, 因為它們在時間和空間上, 經常是在距錯誤源一段距離之後才表現出來。 將錯誤的資料寫到錯誤的位置, 你的程式可能在最終失敗之前運行了好幾個小時,且使程式中止的位置距離錯誤的位置已經很遠啦。而避免這種噩夢的最好方法就是防範於未然。 幸好《深入理解電腦系統》中有一段講: C程式中常見的記憶體操作有關的10種典型編程錯誤,十分經典, 因此抄寫在此,
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-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
Time of Update: 2016-06-27
標籤:c庫的數學函數標頭檔<math.h>所有函數的傳回值都是double,三角函數的角度用弧度表示。sin(double x)、cos(double x)、tan(double x)、asin(double x)、acos(double x)、atan(double x)、atan2(double y,double x)、sinh(double x)(x的雙曲正弦值)、cosh(double x)(x的雙曲餘弦值)tanh(double x)(x的雙曲正切值)exp(double