Time of Update: 2018-12-05
屬性通過所謂的訪問器方法,即訪問資訊的方法,將類變數和方法公開給外部使用(getter ,setter)。使用屬性比使用手動構建的方法更有優勢,包括點標記法和記憶體管理。@interface Car : NSObject{ int year; //類變數 NSString *make; NSString *model; NSArray
Time of Update: 2018-12-05
Objectice-C中使用NSLog來輸出日誌資訊,在Objectice-C和C中字串最大的區別就是"fox"與@"fox",C字串是指向一個位元組字串的指標,而NSString字串(以@開頭)是對象。操作C字串的方法是修改每個位元組中儲存的值。NSString字串是不可變的,你不能訪問每個位元組並編輯他們。而且實際的字串資料也並非儲存在對象中。NSString *fox = @"fox";printf("Hello:%s\n",[fox
Time of Update: 2018-12-05
C++ STL(標準模板庫) 學習資源清單 作者:Winter來源: 最優秀的STL學習網站 C++ STL(標準模板庫) 學習資源清單1 STL網站類 2 STL書籍類 3 STL 技術文章類 STL以其獨特的魅力得到越來越多的程式員鐘愛,STL徹底封裝複雜的資料結構,提供豐富靈活的程式介面,同時還能保證程式的運行效率。上次整理的STL技術文章列表得到許多朋友的捧場,這裡整理更全面的STL學習資源清單,希望對朋友們有所協助。 1 STL網站類 SGI
Time of Update: 2018-12-05
前言最近在圖書館看到了《C#3.0核心技術》這本書,看了一下覺得挺不錯的,C#3.0的技術從基礎文法到新特性到涉及到了,是一部學習C#3.0的好書,本想從網上下載電子版卻沒找不到,卻但看了《C#3.0 in a Nutshell,3rd
Time of Update: 2018-12-05
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using
Time of Update: 2018-12-05
using System;using System.Collections.Generic;using System.Text;using System.IO;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { //執行個體化test類,用於調用該類中的copy函數 test a = new test()
Time of Update: 2018-12-05
現在大部分C#串連資料庫都會是sql server 。但對一些舊的資料庫檔案的串連和操作就不太熟了。 今天就有這個問題,要對FOXPRO產生的DBF檔案資料庫進行操作。 我在CSDN上查了很久,大部分有問題都沒很好地回複到這些操作上的問題。 經過我的實驗,用ODBC來串連它就可以了。 下面是所用的代碼。 都很簡單,就是格式上要注意。和用開的查詢語句會有很大不同。protected void Page_Load(object
Time of Update: 2018-12-05
項目,需要從查詢結果裡把資料匯出到用戶端,之前的方案是通過Excel的組件,在伺服器產生excel檔案,然後下載下來。可以分sheet,但是因為耗記憶體嚴重,匯出很慢,六萬行10列的資料,聽說匯出要40分鐘,我沒試過。後來經過改進得到以下兩個方案。這兩個方案都可以在幾秒內產生上面的資料流。 方案一:因為office2007以下版本,只支援65535行,超過後excel就無法建立或開啟。所以需要進行分sheet進行private static string
Time of Update: 2018-12-05
C# winform 動態添加控制項 以及 事件以下代碼將在載入表單時動態產生若干按鈕,並排列顯示在winform上using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1{
Time of Update: 2018-12-05
private static string FixTag(Match tagMatch) { List<string> events = new List<string>(); events.Add("onclick"); events.Add("onmousedown"); events.Add("onmouseover"); events.Add("onmouseout");
Time of Update: 2018-12-05
代碼Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-05
方法一,原生態:調用filterRepeatChar( "朱雅君,姚怡爾,塗靜,塗靜,劉剛,姚怡爾") public static string filterRepeatChar(string _val) { string _str = string.Empty; string[] strArray = _val.Split(','); for (int i = 0; i < strArray.Length; i++) {
Time of Update: 2018-12-05
方法一:隨機產生不重複數字字串 private int rep=0; /// /// 產生隨機數字字串 /// /// 待產生的位元 /// 產生的數字字串 private string GenerateCheckCodeNum(int codeCount) { string str = string.Empty; long num2 = DateTime.Now.Ticks +
Time of Update: 2018-12-05
Sandcastle是微軟官方的文檔產生工具,NDoc開發停止後,這個貌似也是唯一的一個這方面的工具。它從dll檔案及其xml注釋檔案能夠產生完整的協助文檔,支援多種產生格式(Helpe1x:chm, Helper2x:Hxs, Website,HelperView),結合新發布的Sandcastle Help File
Time of Update: 2018-12-05
在.net2.0 的版本中的 System.Globalization.ChineseLunisolarCalendar 是針對中國的日曆類,西曆與中國傳統農曆紀年之間的相互轉換,利用它可以計算天干地支等有關農曆的資訊。 使用static ChineseLunisolarCalendar cCalendar = new ChineseLunisolarCalendar();cCalendar.MaxSupportedDateTime
Time of Update: 2018-12-05
代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->c# windows程式通過WebService傳輸資料,如果傳輸的資料是DataSet,把DataSet轉換成string進行傳輸,可以大大降低傳輸時間!//用戶端private string DataSetToString(DataSet ds)
Time of Update: 2018-12-05
今天來寫一個UPD1.服務端:代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;using System.Net.Sockets;using System.Net;namespace ConsoleApplication1
Time of Update: 2018-12-05
以往我們都是肯定絞盡腦汁,肯定什麼迴圈,元素大小,什麼因素都考慮進去。但是現在採用Linq可以很好的解決這個問題。找出兩個或多個數組的相同項。代碼相當簡單: 代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Linq;using
Time of Update: 2018-12-05
在第一篇Car的方法中加入一個類方法:+ (NSString *) motto{return(@"Ford Prefects are Mostly Harmless");} #import <UIKit/UIKit.h>#import "Car.h"//統一定義顏色和button風格#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1
Time of Update: 2018-12-05
所謂泛型,即通過參數化型別來實現在同一份代碼上操作多種資料類型,泛型程式設計是一種編程範式,它利用“參數化型別”將類型抽象化,從而實現更為靈活的複用。 C#泛型賦予了代碼更強的型別安全,更好的複用,更高的效率,更清晰的約束。機制: C#泛型能力是由CLR在運行時支援,區別於C++的編譯時間模板機制,和Java的編譯時間的“搽拭法”。這使得泛型能力可以在各個支援CLR的語言之間進行無縫的互操作。