Time of Update: 2017-02-18
C# 將 Json 解析成 DateTable #region 將 Json 解析成 DateTable /// <summary> /// 將 Json 解析成 DateTable。 /// Json 資料格式如: /// {table:[{column1:1,column2:2,column3:3},{column1:1,column2:2,column3:3}]} ///
Time of Update: 2017-02-18
C# 如何識別一個字串是否Json格式 :using System;using System.Collections.Generic;using System.Text;namespace CYQ.Data.Tool{ /// <summary> /// 分隔Json字串為字典集合。 /// </summary> internal class JsonSplit { private static bool
Time of Update: 2017-02-18
<span style="font-size:14px;">using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.ComponentModel;using System.Collections;using
Time of Update: 2017-02-18
/// <summary> /// 提供方法將其他類型轉換為Json /// </summary> public static class ConvertToJson { #region 私人方法 /// <summary> /// 過濾特殊字元 /// </summary> /// <param
Time of Update: 2017-02-17
最近無意中看到了:http://www.php.cn/。但是,人笨啊,木有看懂到底是啥意思,木辦法自己寫一個試試吧,權當做個筆記例子如下:介面:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace WhereTest{ /// <summary> /// 水果介面 /// </summary> public
Time of Update: 2017-02-17
原文地址:點擊開啟連結本文翻譯自CodeProject上的一篇文章,原文地址。目錄介紹做最壞的打算提前檢查不要信任外部資料可信任的裝置:網路攝影機、滑鼠以及鍵盤 “寫操作”同樣可能失效安全編程不要拋出“new
Time of Update: 2017-02-17
英文原文:Maoni Stephens,編譯:趙玉開(@玉開Sir)CLR記憶體回收行程根據所佔空間大小劃分對象。大對象和小對象的處理方式有很大區別。比如記憶體磁碟重組 —— 在記憶體中移動大對象的成本是昂貴的,讓我們研究一下記憶體回收行程是如何處理大對象的,大對象對程式效能有哪些潛在的影響。大對象堆和記憶體回收在.Net
Time of Update: 2017-02-17
原文地址:http://www.php.cn/假設我們公司有兩種程式員:VB程式員,指的是用VB寫程式的程式員,用clsVBProgramer這個類表示;Delphi程式員指的是用Delphi寫程式的程式員,用clsDelphiProgramer這個類來表示。每個類都有一個WriteCode()方法。定義如下:class clsVBProgramer(){....WriteCode(){ //用VB語言寫代碼;}....}class
Time of Update: 2017-02-20
C# 怎麼檢測string字串中有哪些數字? //測試函數 private void Form1_Load(object sender, EventArgs e) { foreach (var number in ExtractNumbersFromString("abc2345 345fdf678 jdhfg945")) { MessageBox.Show(number.
Time of Update: 2017-02-20
C# 根據列名與列值設定當前行 /// <summary> /// 根據GridView中某列的值與列名來設定當前行 /// </summary> /// <param name="gv">待設定當前行的GridView</param> /// <param name="FilterCellValue">某列的值</param>
Time of Update: 2017-02-20
C# 對Word文檔進行處理 public partial class Form1 : Form { public Microsoft.Office.Interop.Word.Document document; public Microsoft.Office.Interop.Word.ApplicationClass wd = null; public string filename = null; private bool
Time of Update: 2017-02-20
1、建立表 private DataTable vsDt =new DataTable();2、清空表中內容(表中的列還在)vsDt.Clear();3、清空表中的列vsDt.Columns.Clear();4、表中添加列vsDt.Columns.Add("BH", typeof(string));vsDt.Columns.Add("RQ", typeof(string));5、表中添加空行 DataRow vsDr = vsDt.NewRow();
Time of Update: 2017-02-20
C# 格式化string類型的金額 /// <summary> /// 根據精度將金額轉換為自訂類型的string /// </summary> /// <param name="precision">需要的精度</param> /// <param name="money">需要轉換的金額</param>
Time of Update: 2017-02-20
原文地址:點擊開啟連結[摘要]本文介紹C# WinForm多線程開發之Thread類庫,並提供簡單的範例程式碼供參考。Windows是一個多任務的系統,如果你使用的是windows 2000及其以上版本,你可以通過工作管理員查看當前系統啟動並執行程式和進程。什麼是進程呢?當一個程式開始運行時,它就是一個進程,進程所指包括運行中的程式和程式所使用到的記憶體和系統資源。而一個進程又是由多個線程所組成的,線程是程式中的一個執行流,每個線程都有自己的專有寄存器(棧指標、程式計數器等),但代碼區是共用的,
Time of Update: 2017-02-20
原文地址:點擊開啟連結[摘要]本文介紹C# WinForm多線程開發之ThreadPool 與 Timer,並提供詳細的範例程式碼供參考。本文接上文,繼續探討WinForm中的多線程問題,再次主要探討threadpool 和timer。一
Time of Update: 2017-02-20
原文地址:點擊開啟連結[摘要]本文介紹C# WinForm多線程開發之Control.Invoke,並提供詳細的範例程式碼供參考。下面我們就把在Windows
Time of Update: 2017-02-18
1、建立測試dll及方法,用vs2010建立winform程式,具體代碼如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace reflect{ public
Time of Update: 2017-02-18
C# 擷取Excel工作薄中Sheet頁(工作表)名集合 #region 擷取Excel工作薄中Sheet頁(工作表)名集合 /// <summary> /// 擷取Excel工作薄中Sheet頁(工作表)名集合 /// </summary> /// <param
Time of Update: 2017-02-18
C# 讀取Excel中的資料 #region 讀取Excel中的資料 /// <summary> /// 讀取Excel中的資料 /// </summary> /// <param name="excelFile">Excel檔案名稱及路徑,EG:C:\Users\JK\Desktop\匯入測試.xls</param> ///
Time of Update: 2017-02-18
最近在做匯入Excel資料的時候,要檢驗資料是否重複: 1、要檢驗Excel資料本身是否有重複? 2、Excel中的資料是否與資料庫中的資料重複?一、檢驗Excel中資料是否重複的方式有: 1、將Table中的資料使用select語句來過濾(此處略,可以參考二)。 2、使用for迴圈來手動核對,代碼如下: #region 記錄Excel中的重複列 /// <summary> ///