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)順序執行,也就是一條語句一條語句按順序執行;(2)條件執行,也就是if...else.當某種條件滿足時執行一些代碼;(3)迴圈執行,就是當某種條件滿足的時候,重複執行某些代碼。很多複雜的軟體應用都是通過這三種方式的神奇的組合而產生的。前面我們已經講過了順序執行和條件執行。在這一節練習中,我們要瞭解一下迴圈執行。在C#中我們在日常工作經常用到的迴圈執行有兩種。(1)while迴圈;(2)for迴圈;
Time of Update: 2016-06-29
標籤:一、對象 和 類型 結構和類的區別在於它們的儲存方式、訪問方式(類儲存在堆(heap)上的參考型別,而結構是儲存在棧(stack)上的實值型別 )ps:區別 參考型別 和 實值型別 ,請回憶(兩個孩子手上的棒棒糖) 和 (兩個孩子搶遙控器看電視)的例子ref 參數迫使變數通過
Time of Update: 2016-06-28
標籤: int[] ss = new int[6]; Random s = new Random();
Time of Update: 2016-06-28
標籤:輸入每個人的中獎號碼,進行滾動顯示 //清屏 //隨即一個索引 // 根據索引列印 //等待0.1秒 Console.Write("請輸入參與者人數:"); &
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
標籤: /// <summary> /// 建立xml檔案 /// </summary> /// <param name="xmlDoc">xml</param> /// <returns></returns> public string CreateXml(string xmlDoc) { string
Time of Update: 2016-06-29
標籤:System.Collections命名空間包含可使用的集合類和相關的介面。該命名空間下的.NET非泛型集合類如下所示:— System.Collections.ArrayList:數組集合類,使用大小可按動態增加的數組實現Ilist介面。— System.Collections.BitArray:布爾集合類,管理位值的壓縮數組,該值為布爾值。— System.Collections.Queue:隊列,表示對象的先進先出集合。—
Time of Update: 2016-06-28
標籤:static void Main(string[] args) { //Action TestAction<string>(Action, "Hello"); TestAction<int>(Action, 1000); TestAction<string>(p => { Console.WriteLine(p); }, "Lamada");
Time of Update: 2016-06-29
標籤:自己寫了幾個常用的HTTP方法,貼出來方便自己尋找。using System.Text;using System.Net;using System.IO;namespace Test{ public class HttpMethod { public static string HttpGet(string URL) { HttpWebRequest req =
Time of Update: 2016-06-29
標籤:jenkins 使用 maven 出現 C:\Windows\system32\config\systemprofile 的原因是 Jenkins 服務啟動的帳號使用了系統的帳號,在服務裡改成具體的案頭使用者帳號即可。If your command runs fine on Win command prompt as user ‘X‘, then you should run Jenkins with the same user.This can be achieved by
Time of Update: 2016-06-29
標籤:URL編碼,預設UTF8編碼方式 /// <summary>/// URL編碼,預設UTF8編碼方式/// </summary>/// <param name="_SourceString"></param>/// <returns></returns>public static String URLEncoding_UTF8(this String _SourceString){ return
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# 串口操作系列(4) -- 協議篇,文本協議資料解析標籤: c#uiobjectstringbyte2010-06-09 01:50 19739人閱讀 評論(26) 收藏 舉報 分類: 通訊類庫設計(4) 著作權聲明:本文為博主原創文章,未經博主允許不得轉載。上一篇已經介紹了協議的組成,一個協議,一般具有 :協議頭+長度+資料+校正 ,
Time of Update: 2016-06-27
標籤:C# 類是怎麼執行的?public class Person{static person(){} //不寫,預設也有個空的public person(){}//不寫,預設也有個空的public string Name{get;private set;}
Time of Update: 2016-06-28
標籤:返回單個值 /// </summary> /// <param name="user">使用者資訊</param> /// <returns></returns> public static int VerifyUser(clsUser user) { int iRet;
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-28
標籤:1、sscanf函數原型:int sscanf(const char *,const char *,...);int sscanf(const char *buffer,const char
Time of Update: 2016-06-28
標籤: C函數可以通過堆棧來和Lua交換資料,但有時候C函數需要在函數體的範圍之外儲存某些Lua資料,那麼我們想到全域變數或static變數,這樣做的缺點是:為Lua設計C函數庫時,導致不可重新進入;不是所有的Lua值都能很好的儲存到C變數中。那麼可不可以將值儲存在Lua全域變數裡面呢,可以,Lua就提供了一個獨立的被稱為registry的表,但是Lua代碼本身不能訪問它。registry全域註冊表解釋:一個普通的Lua表,使用假索引(pseudo-index)LUA_REGISTRYINDE