Time of Update: 2016-08-22
標籤:委託是一個類,它定義了方法的類型,使得可以將方法當作另一個方法的參數來進行傳遞。事件是一種特殊的委託。 1.委託的聲明 (1). delegate delegate我們常用到的一種聲明 Delegate至少0個參數,至多32個參數,可以無傳回值,也可以指定傳回值類型。
Time of Update: 2016-08-24
標籤:數組的大小是固定的。如果元素個數動態,就使用集合類。List<T>是與數組相當的集合類。其他的集合:隊列、棧、鏈表、字典和集。.NET Framework 1.0 包括非泛型集合類,如 ArrayList 和 HashTable 。建立ListList<int> list = new List<int>();使用預設建構函式建立一個空列表。如果列表添加元素後,容量會擴大為 4 個元素。如果添加 第 5 個元素,容量為 8
Time of Update: 2016-08-22
標籤:得到選中項的value值並拼接成一個字串返回public string GetChecked(CheckBoxList checkList, string separator) { string str = ""; for (int i = 0; i < checkList.Items.Count; i++) { if (checkList.Items[i].Selected) {
Time of Update: 2016-08-18
標籤: 1、比較字串 String 類提供了一系列的方法用於字串的比較,如CompareTo 和 Equals方法等。 ① CompareTo : 如果參數的值與此執行個體相等,則返回0;如果此執行個體大於參數的值,則返回1;否則返回-1。 string str1 = "abc"; int m1 = str1.CompareTo("abc"); // m1 = 0 int m2 = str1.CompareTo("ab"); //m2 = 1
Time of Update: 2016-08-15
標籤:類繼承 和 介面繼承類繼承 一個類型派生於一個基類行,它擁有該基底類型的所有成員欄位和函數。介面繼承 一個類型繼承函數的簽名,不需要實現代碼。 多重繼承一個類派生自多個類。多重繼承編寫非常複雜,難維護。因此C# 不支援多重繼承。但可以 派生自多個介面,多重介面繼承。結構和類結構(實值型別) 和
Time of Update: 2016-08-14
標籤:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms; namespace GetDeskDirectory{ public partial class Form1 :
Time of Update: 2016-08-16
標籤:1、取字串的前n個字元(1)string str1=str.Substring(0,n);(2)string str1=str.Remove(i,str.Length-n); 2、去掉字串的前n個字元string str1=str.Remove(0,n);string str1=str.SubString(n); 3、從右邊開始取n個字元:string str1=str.SubString(str.Length-n);string
Time of Update: 2016-08-09
標籤: 最近做一個項目要獲得ScrollBar的位置,因為.net找不到此類功能,只好用MFC中的函數了,GetScrollPos只返回listview頂部的位置,此時我找到了GetScrollInfo,覺得此函甚好。不成想從網上找到範例程式碼後,函數執行成功了,但是返回了false,查下msdn,說是沒取到資訊,然後我又用GetLastError想查看下錯誤資訊,但是返回0,就是沒有錯誤,這就納悶了。 後來又在網上不停的找,找到pinvoke這個網站,這有比較正規的調用例子http://w
Time of Update: 2016-08-14
標籤: 一、刪除 string constr = "server=.;database=test;uid=sa;pwd=sa"; SqlConnection
Time of Update: 2016-08-09
標籤:其他不多說,直接上例子,我引用的是layer彈框的移動端外掛程式一、頁面<head>調用下面方法<script src="/js/layer.js"></script> <script> function alertFn(msg) { layer.open({ content: msg , shadeClose: false,
Time of Update: 2016-08-09
標籤: //產生WORD程式對象和WORD文檔對象 Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document doc = new Document(); object miss =
Time of Update: 2016-08-16
標籤:最近C盤真的空間越來越小了,記下簡單的幾個操作步驟以便以後用到。 參考文檔: http://jingyan.baidu.com/article/90808022a6c6b7fd91c80fc8.html 1. 刪除卷 擴充卷不能使用是由於你所壓縮的分區與C盤不是順序相鄰的分區導致的; 首先,開啟電腦管理,在【電腦】表徵圖(Windows8.1為【這台電腦】 Windows7/Vista為【電腦】 之前系統為【我的電腦】)上右鍵單機 之後便進入管理主控台,單機【儲存】-【磁碟管理】
Time of Update: 2016-08-14
標籤:介面效果1.提取漢字 private void buttonX1_Click(object sender, EventArgs e) { if (TxtYuan.Text.Trim() != "") { string Text = TxtYuan.Text.Trim(); string TTT = ""; Regex reg = new
Time of Update: 2016-08-16
標籤:this關鍵字引用類的當前執行個體1/限定被相似的名稱隱藏的成員2/將對象作為參數傳遞到其他方法3/聲明索引器實際案例參考://成員類 public class Employee { private string _MyName; private int _MyAge; public string[] _arry = new string[5]; public string Name { get { return
Time of Update: 2016-08-05
標籤: static void Main(string[] args) {// //AddInventory(); System.Timers.Timer timer = new System.Timers.Timer(); timer.Enabled = true; timer.Interval = 60000; timer.Start();
Time of Update: 2016-08-03
標籤:Microsoft(R) 產生引擎版本 4.6.1055.0[Microsoft .NET Framework 版本 4.0.30319.42000]著作權 (C) Microsoft Corporation。著作權所有,並保留一切權利。文法: MSBuild.exe [選項] [專案檔]描述: 在專案檔中產生指定的目標。如果 未指定專案檔,MSBuild 將搜尋
Time of Update: 2016-08-03
標籤:using System;using System.Text;using EMS.Domains.Core;using System.Web.Mvc;using Json.Net;using Util.Webs;using Json = Util.Json;namespace EMS.MvcUI.Base{ public class FilterExceptionAttribute : FilterAttribute, IExceptionFilter {
Time of Update: 2016-08-11
標籤:#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_COL20#define MAX_INPUT 1000int read_column_numbers(int columns[], int max);void rearrange(char *output, char *input, int n_columns, int const columns[]);int
Time of Update: 2016-08-10
標籤:/************************************************************************* * I.MX6 su.c 測試 * 說明: * 今天突然想分析一下su的原始碼,看一下其工作機制。 * * 2016-8-10 深圳 南山平山村 曾劍鋒 *************************
Time of Update: 2016-08-18
標籤:C語言通過運行時堆棧支援遞迴函式的實現,遞迴函式時直接或者間接調用自身的函數,經常有人拿斐波那契實現當做遞迴的實現,然後這樣做效率並不高。n < 1; Fib(1) =1n = 2; Fib(2) = 1n > 2; Fib(n) = Fib(n - 1) + Fib(n -