Time of Update: 2018-12-07
前幾天與同事激烈討論了一下,有一點收穫,記錄起來。首先給出MSDN的定義:lock
Time of Update: 2018-12-07
View Code 1 1、ArrarList 轉換為 string[] : 2 3 ArrayList list = new ArrayList(); 4 5 list.Add("aaa"); 6 7 list.Add("bbb"); 8 9 //轉換成數組10 11 string[] arrString = (string[])list.ToArray(typeof( string)) ;12 13 2、string[] 轉換為 ArrarList :14
Time of Update: 2018-12-07
1. 常成員函數的const必須出現在聲明和定義中。2. 類的成員函數只能重載本類的其它成員函數,成員函數與類外的非成員函數、其它類的成員函數無關。3. 類內部定義的成員函數,自動作為inline處理。4. 在成員函數的聲明和定義處指定inline都是合法的,任選一個位置都行。但是由於inline函數必須在調用它的每個源檔案中可見,所以不在類定義中定義的inline函數,其定義通常應放在類定義的同一標頭檔中。5.
Time of Update: 2018-12-07
1. CLR – Common Language Runtime為.NET應用程式提供運行環境。定位、載入和管理.NET類型,同時也負責一些底層細節的工作,如記憶體管理、建立應用程式定義域、線程和物件內容邊界,安全檢查等等。 2. CTS – Common Type System完整描述了運行庫所支援的所有可能的資料類型和編程結構,指定了這些實體之間如何互動,也規定了它們在.NET中繼資料格式中的表示。 CTS包括5種基本類型:class, interface, enum, delegate
Time of Update: 2018-12-07
using System.Net;using System.IO;using System.Text; //方法一: // Create a request for the URL. WebRequest request = WebRequest.Create("http://www.hao123.com/"); // If required by the server, set the credentials.
Time of Update: 2018-12-07
原帖:http://chenyaqiong81081.blog.163.com/blog/static/44622594200791235256255/一、Runtime.getRuntime().exec()執行命令情況: Runtime.getRuntime().exec("cmd /c your command")//2000 Runtime.getRuntime().exec("command /c your command")//98
Time of Update: 2018-12-07
C#的office操作[word&Excel]C#實現對Word檔案讀寫 手頭上的一個項目報表相對比較簡單,所以報表列印採用VBA引擎,通過定製Word模版,然後根據模版需要填充資料,然後OK,列印即可。 實現方法:首先需要引用VBA組建,我用的是Office2003 Professional,Dll版本號碼為Microsoft Word11.0 另外當然還需要引用Interop.Word.Dll. 代碼如下:///#region
Time of Update: 2018-12-07
Word.ApplicationClass word = new Word.ApplicationClass(); Type wordType = word.GetType(); Word.Documents docs = word.Documents; // 開啟檔案 Type docsType = docs.GetType(); object filename = "c:\\"; Word.Document doc =
Time of Update: 2018-12-07
摘要:本文介紹了Excel對象、C#中的受管代碼和非受管代碼,並介紹了COM組件在.NET環境中的使用。 關鍵詞:受管代碼;非受管代碼;Excel對象;動態串連庫 引言 Excel是微軟公司辦公自動化套件中的一個軟體,他主要是用來處理試算表。Excel以其功能強大,介面友好等受到了許多使用者的歡迎。在設計應用系統時,對於不同的使用者,他們對於列印的需求是不一樣的,如果要使得程式中的列印功能適用於每一個使用者,可以想象程式設計是十分複雜的。由於Excel表格的功能強大,又由於幾乎每一台機器
Time of Update: 2018-12-07
作者:wyhw 發表時間:2003-5-11 很奇怪..wyhw的文章在其它網站有轉貼,自己的網站卻沒有..不知道是不是同名同姓的? -_-!
Time of Update: 2018-12-07
參考《ASP.NET與SQL一起打包部署安裝》,這篇文章是針對VB.NET與SQL 一起打包的,但是我使用的是C#,當然只要修改一下主要安裝類庫就行了!C#的類庫代碼如下:DBCustomAction.csusing System;using System.Collections;using System.Data.SqlClient;using System.ComponentModel;using System.Configuration.Install;using
Time of Update: 2018-12-07
可以反加兩個日期之間任何一個時間單位。private string DateDiff(DateTime DateTime1, DateTime DateTime2) {string dateDiff = null; TimeSpan ts1 = new TimeSpan(DateTime1.Ticks); TimeSpan ts2 = new TimeSpan(DateTime2.Ticks); TimeSpan ts =
Time of Update: 2018-12-07
在瞭解HTTP斷點續傳的原理之前,讓我們先來瞭解一下HTTP協議,HTTP協議是一種基於tcp的簡單協議,分為請求和回複兩種。請求協議是由客戶機(瀏覽器)向伺服器(WEB SERVER)提交請求時發送報文的協議。回複協議是由伺服器(web server),向客戶機(瀏覽器)回複報文時的協議。請求和回複協議都由頭和體組成。頭和體之間以一行空行為分隔。 以下是一個請求報文與相應的回複報文的例子: GET /image/index_r4_c1.jpg HTTP/1.1 Accept: */*
Time of Update: 2018-12-07
參考《ASP.NET與SQL一起打包部署安裝》,這篇文章是針對VB.NET與SQL 一起打包的,但是我使用的是C#,當然只要修改一下主要安裝類庫就行了!C#的類庫代碼如下:DBCustomAction.csusing System;using System.Collections;using System.Data.SqlClient;using System.ComponentModel;using System.Configuration.Install;using
Time of Update: 2018-12-07
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using
Time of Update: 2018-12-07
http://topic.csdn.net/u/20080709/10/9b299342-c509-4e8c-908f-982d186d4a99.html 前言 項目由於以前是把資料庫和主程式放在一台電腦上,所以出於安全目的現在要把資料庫和程式分離,把資料庫放到內網裡,不公布到外網上.這樣一般的資料庫操作都沒問題,就是備份與還原資料庫需要實現遠程備份與還原.
Time of Update: 2018-12-07
String.Format舉例(C#,VB.Net)我自己在用到的:String.Format("字串:{0:d5}", 12)"字串:00012" '佔位5個,不足的用0代替String.Format("字串:{0,5}", 12)"字串: 12" '佔位5個,不足的用空格代替,靠右對齊String.Format("字串:{0,-5}", 12)"字串:12 " '佔位5個,不足的用空格代替,靠左對齊?String.Format("字串:{0:#,0.0000}", 12)"字串:12
Time of Update: 2018-12-07
1 寫一個繼承自IHttpHandler的類,並產生DLL;using System;using System.Web;using System.Collections.Generic;using System.Text;namespace ImgProtect{ public class ImgProtectHadler:IHttpHandler { public bool IsReusable { get {
Time of Update: 2018-12-07
c#把json格式轉化為物件類型這裡我只能解析jsonStr="{'name':'tom','age':'11'}"的情況,如果這裡的jsonStr="{'name':'tom','age':'11'},{'name':'tom','age':'11'}" ,我就解析不出來了,還請高手指點啊。 #region c#把json解析為物件類型(通過對象名點屬性名稱可以讀出資料(方便啊)) public void JsonTooo() {
Time of Update: 2018-12-07
問題:需要在控制台讓使用者輸入,但是希望可以接受使用者的多行輸入,而不是有限制的一行。解決方案: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->static string acceptmultiLine(){ConsoleKeyInfo cki;Console.TreatControlCAsInput =