Time of Update: 2015-12-22
標籤:C#造福大家不管什麼資料,只要沾上大資料,效率,快速,批量 都是一件很讓人頭疼的事情。尤其是遇到了Access這種資料庫。這個沒有什麼好的辦法,只好一條一條的寫SQL插入了。 在這提供2種思路。第一種是寫事物去處理。這點大家都懂的。第二種是用批次更新。很奇怪這2種方法的處理速度都差不多。都比一條一條的插入塊。那看你高興了。如果你有更快的方法,請不要忘記了我 [email protected]以下是2中代碼 1.用事物處理
Time of Update: 2015-12-22
標籤:剩下十天左右時間,準備一下筆記題,也鞏固一下基礎知識。本想萬一找不到合適的就在家脫產學到過年算了,後來想想確實沒必要,就算年前不好找工作,無非是錢多錢少、路遠路近的問題。實在找不到滿意的,可以先湊合著工作兩三個月,到轉正時如果薪資什麼的還達不到要求,到時年初比較好找工作。對著書也看不出什麼來,就在網上找找筆試面試題,簡單的看看就算了,有些經典的有代表性的,隨手記錄下來。主要是看園內”漢城節度使“去年四月的長文,邊看邊記一些感想,有一些複製和刪改。其餘查的資料就不一一
Time of Update: 2015-12-22
標籤:項目中需要使用串口熱敏印表機,所以研究一下串口列印。using System;using System.Linq;using System.Collections.Generic;using System.Text;using System.IO.Ports;using System.Collections;using System.Windows.Forms;using System.Drawing;namespace PrinterTest{ public class
Time of Update: 2015-12-22
標籤:假設1我有個類叫SortClass,類中有個BubbleSort(int[] array)用於給數組進行排序。假設2我有個類叫SortT<T>,類中有個BubbleSort(T[] array)用於給數組進行排序。現在我需要在控制台應用程式裡通過反射調用BubbleSort方法為數組int[] array進行排序。int[] array = new int[] { 1,7,98,165,4,8,97
Time of Update: 2015-12-22
標籤:一.說明 我們自己編寫程式的介面,會遇到各種螢幕分辨 率,只有自適應才能顯的美觀。實際上,做到這點也很簡單,就是首先記錄表單和它上面控制項的初始位置和大小,當表單改變比例時,其控制項的位置和大小也按此比
Time of Update: 2015-12-22
標籤:C#中Split用法~1、用字串分隔: using System.Text.RegularExpressions;string str="aaajsbbbjsccc";string[] sArray=Regex.Split(str,"js",RegexOptions.IgnoreCase);foreach (string i in sArray) Response.Write(i.ToString()
Time of Update: 2015-12-22
標籤:1.在項目中建立類AutoSizeFormAutoSizeForm.cs檔案代碼:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace CSharpFormApplication{ class AutoResizeForm {
Time of Update: 2015-12-22
標籤:C#——DataGridView選中行,在TextBox中顯示選中行的內容,在DataGridView的SelectionChanged實踐中設定如下代碼privatevoiddataGridView1_SelectionChanged(objectsender, EventArgse) {intindex=dataGridView1.SelectedRows[0].Index;
Time of Update: 2015-12-22
標籤:參照園友freeliver54代碼而做的,再根據需求做的,菜鳥一隻有問題儘管提出來---------------------------------------------------------------------- 1 private void t_btn_kill_Click(object sender, EventArgs e) 2 { 3 int port; 4 bool b = int.
Time of Update: 2015-12-22
標籤:如已綁定過資料來源:DataTable dt = (dataGridView1.DataSource as DataTable) 如未綁定過資料來源: public DataTable GetDgvToTable(DataGridView dgv) { DataTable dt = new DataTable(); // 列強制轉換 for (int count = 0;
Time of Update: 2015-12-22
標籤:// 按比例縮放圖片 public Image ZoomPicture(Image SourceImage, int TargetWidth, int TargetHeight) { int IntWidth; //新的圖片寬 int IntHeight; //新的圖片高 try {
Time of Update: 2015-12-22
標籤:以前一直沒搞懂為什麼C#在做對象序列化時(Json序列化,XML序列化等)有時候會出現循環參考的問題,下面寫了個例子,類People有一個屬性引用了類Child,而類Child也有一個屬性引用了類People,並且兩個屬性的get訪問器中都會new一個彼此類型的對象,這樣在訪問People類的Child屬性的時候就會new一個Child對象,在訪問Child類的People屬性的時候又會new一個People對象。所以C#序列化方法在序列化People類的Child屬性時又會去序列化Chi
Time of Update: 2015-12-21
標籤:獲得當前系統時間: DateTime dt = DateTime.Now;Environment.TickCount可以得到“系統啟動到現在”的毫秒值DateTime now = DateTime.Now;Console.WriteLine(now.ToString("yyyy-MM-dd")); //按yyyy-MM-dd格式輸出sConsole.WriteLine(dt.ToString()); // 26/11/2009 AM
Time of Update: 2015-12-21
標籤:一、練習題:使用結構體輸入學員資訊,學號 姓名 分數排序之後按分數從高到低輸出 class Program { //使用者自訂,我們自己定義這種資料類型 public struct student { public int Code;//成員變數 public string Name;//成員 public double Degree;//成員
Time of Update: 2015-12-21
標籤:/// <summary>/// 過濾空格、換行、script、style等等標籤/// </summary>/// <param name="html">html的內容</param>/// <returns>處理後的文本</returns>internal static string SHTML(string html){ html = html.Trim(); html = html.Replace(@"
Time of Update: 2015-12-21
標籤:命名空間:System.String.Split 程式集:mscorlib( mscorlib.dll) 簡單一實例: string before = "12,50,30"; string[] after =before.Split(new char[]{‘,‘}); //結果為 after[0] = 12; after[1] = 50; after[2] = 30; 1.正則表達
Time of Update: 2015-12-21
標籤:命名空間:System.String.Split程式集:mscorlib( mscorlib.dll) 簡單一實例:string before = "12,50,30";string[] after =before.Split(new char[]{‘,‘}); //結果為 after[0] = 12; after[1] = 50; after[2] =
Time of Update: 2015-12-21
標籤:上一章簡約的介紹了CkEditor編輯器,可以編輯js邏輯代碼,css,html,C#代碼,這章我根據實際例子,講解怎麼編寫C#代碼和怎麼調用它。大家都還記得剛剛接觸程式編時的hello Word吧,首先我來介紹在編輯器上寫了返回“hello Word”的C#方法,讓後怎麼去調用返回對應hello Wrod方法,具體代碼如下:運行預覽效果如頁面載入之後就彈出了hello world對話方塊。證明擷取到了我們寫返回字串。注意編輯C#代碼
Time of Update: 2015-12-22
標籤:/*UTF-8 valid format list:0xxxxxxx110xxxxx 10xxxxxx1110xxxx 10xxxxxx 10xxxxxx11110xxx 10xxxxxx 10xxxxxx 10xxxxxx111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx*/char *filter_none_utf8_chars(char
Time of Update: 2015-12-21
標籤:C編程基礎1. Hello World!依照慣例首先Hello World鎮樓:1 #include<stdio.h>2 3 int main(void) {4 printf("Hello World!\n");5 return 0;6 } C源檔案組成: (1) 預先處理指令(不是c語句) (2)