Time of Update: 2016-05-06
標籤:一、建立window服務1、建立項目-->選擇Windows服務。預設組建檔案包括Program.cs,Service1.cs2、在Service1.cs添加如下代碼: System.Timers.Timer timer1; //計時器 public Service1(
Time of Update: 2016-05-07
標籤:先介紹下關於資料庫的串連:我們首先通過connection對象對資料連線:string str1 = Application.StartupPath; string str = "provider=Microsoft.Jet.OLEDB.4.0; data Source="[email protected]"\telephone.mdb; Persist Security Info=False";
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 public class MyTestClass 9 {10 /// <summary>11 /// 12 /// </summary>13
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Runtime.InteropServices; 5 using System.Text; 6 7 namespace ClassTrining 8 { 9 class Demo 10 { 11 //===============屬性===============
Time of Update: 2016-05-08
標籤:前言之所以要寫這篇關於C#反射的隨筆,起因有兩個: 第一個是自己開發的網站需要用到 其次就是沒看到這方面比較好的文章。所以下定決心自己寫一篇,廢話不多說開始進入正題。 前期準備在VS2012中建立一個控制台應用程式(我的命名是ReflectionStudy),這個項目是基於.net 4.0。接著我們開啟Program.cs檔案,按照如下在Program中寫一個我們自己的類: 1 public class RefClass 2
Time of Update: 2016-05-08
標籤:產生類似 LS14120002 private String GenNewOrder() { String newOrder; var orders = LYOrder.Items; String lastOrder = ((Order)orders[orders.Count - 1]).OrderNum; //int len = lastOrder.Length;
Time of Update: 2016-05-06
標籤:/// <summary> /// 清理資源回收筒垃圾 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e)//按鈕事件 {
Time of Update: 2016-05-07
標籤:變數的初始化和範圍C#的預定義資料類型流量控制枚舉名稱空間預先處理命令C#編程的推薦規則和約定變數的初始化和範圍 初始化 C#有兩個方法可以一確保變數在使用前進行了初始化:變數是欄位,如果沒有顯式初始化,建立這些變數時,其預設值為0。方法的局部變數必須在代碼中顯式初始化,之後才能在語句中使用,如果在初始化之前使用了他的值,報錯。 範圍 如果局部變數範圍衝突,報CS0136錯。 欄位與局部變數衝突,隱藏掉欄位,訪問被隱藏的執行個體欄位用this關鍵字,靜態欄位使用obj
Time of Update: 2016-05-07
標籤:SerialPort中串口資料的讀取與寫入有較大的不同。由於串口不知道資料何時到達,因此有兩種方法可以實現串口資料的讀取。一、線程即時讀串口;二、事件觸發方式實現。由於線程即時讀串口的效率不是十分高效,因此比較好的方法是事件觸發的方式。在SerialPort類中有DataReceived事件,當串口的讀緩衝有資料到達時則觸發DataReceived事件,其中SerialPort.ReceivedBytesThreshold屬性決定了當串口讀緩衝中資料多少個時才觸發DataReceived事
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 public class 事件處理類 9 {10 /// <summary>11 /// 聲明欄位12 /// </summary>13
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 class 事件 9 {10 class Demo11 {12 /// <summary>13 ///
Time of Update: 2016-05-07
標籤:C# 工作中遇到的幾個問題1.將VS2010中的代碼編輯器的預設字型“新宋體”改為“微軟雅黑”後,代碼的注釋,很難對齊,特別是用SandCastle Help File Builder產生協助文檔中後,代碼注釋不能對齊。2.在代碼注釋區:1 /// <remarks>2 /// http請求使用說明3 /// <code>4 ///
Time of Update: 2016-05-07
標籤: 程式如何以管理員身份運行程式 最近在項目運行過程中遇到了一個問題,就是開啟程式的過程中,軟體會出現開啟資料庫是一個唯讀資料庫,我們需要將用戶端設定為以管理員身份運行才能解決這種問題。這樣雖然可以解決問題但是卻給使用者和與用與溝通的人員帶來了不便,使軟體的簡易性與易操作性大打折扣。
Time of Update: 2016-05-07
標籤: 初學者在開始學習的時候,對於委託很難做到一下子理解,其中也包括我。委託好比一座大山,沒爬上山頂就不能有“一覽眾山小”的感覺,只有你真正的爬到山頂的時候,才會發現大自然的是神奇。 委託我們可以把它認為是一個類,而不是一個方法。用委託我們可以調用方法,來簡化程式,非常像C++中的指標。
Time of Update: 2016-05-06
標籤:前端代碼 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Comp_Paging.ascx.cs" Inherits="Inc_Comp_Comp_Paging" %><style type="text/css"> #Page_Tale { margin: 20px auto; }</style><table width="100%"
Time of Update: 2016-05-07
標籤:#include <stdio.h>#include <stdlib.h>#include <string.h>/*static*/ unsigned long Crc32_ComputeBuf( unsigned long inCrc32, const void *buf,
Time of Update: 2016-05-07
標籤:前言: 對於ios項目開發中總會遇見各種集合遍曆,出於對各種遍曆效率的好奇心,所以準備寫個測試程式測試一下 首先:先聲明一個NSMutableArray,測試資料量分別是1000條,10000條,100000條。int testMaxCount =1000;//10000,100000 NSMutableArray *testArray=[[NSMutableArray alloc]init]; for (int i =0;
Time of Update: 2016-05-07
標籤:題目描述:Description Bob got a job as a system administrator in X corporation. His first task was to connect n servers with the help of m two-way direct connection so that it becomes possible to transmit data from one server to any other server via
Time of Update: 2016-05-07
標籤:main.m//// main.m// 05-protoco//// Created by apple on 13-8-11.// Copyright (c) 2013年 itcast. All rights reserved.///* 1.協議的定義 @protocol 協議名稱 <NSObject> // 方法聲明列表.... @end 2.如何遵守協議 1> 類遵守協議 @interface 類名 : 父類名 <協議名稱1, 協議名稱2>
Time of Update: 2016-05-06
標籤:指向指標的指標是一種多級間接定址的形式,或者說是一個指標鏈。通常,一個指標包含一個變數的地址。當我們定義一個指向指標的指標時,第一個指標包含了第二個指標的地址,第二個指標指向包含實際值的位置。一個指向指標的指標變數必須如下聲明,即在變數名前放置兩個星號。例如,下面聲明了一個指向 int 類型指標的指標:int **var;當一個目標值被一個指標間接指向到另一個指標時,訪問這個值需要使用兩個星號運算子,如下面執行個體所示: 1 #include <stdio.h> 2 3