標籤:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace 分布式日誌{ public class MyExceptionFilter : HandleErrorAttribute { public static Queue<Exception> listQueue = new Queue&
標籤: 判斷一個字元是不是漢字通常有三種方法,第一種用 ASCII 碼判斷,第二種用漢字的 UNICODE 編碼範圍判 斷,第三種用Regex判斷,以下是具體方法。 1、用ASCII碼判斷 在 ASCII碼錶中,英文的範圍是0-127,而漢字則是大於127,具體代碼如下:string text = "是不是漢字,ABC"; for (int i = 0; i < text.Length; i++) { if ((int)text[i]
標籤:題目要求:使用者隨機輸入字母及數字組成的字串,當使用者連續輸入字串‘hello’時,程式結束使用者輸入,並分別顯示使用者輸入的字母及數位數目。代碼:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 字元操作{ public class Program { public static void Main()
標籤:在 GUI 中執行非同步作業 序 目錄 一、在 GUI 程式中執行非同步作業 下面通過表單樣本示範以下操作-點擊按鈕後:①將標籤內容改成:“Doing”,並將按鈕禁用(表示執行中);②線程掛起3秒(類比耗時操作);③將標籤內容改為:“Complete”,並啟用按鈕(表示執行完成); 1 public partial class Form1 : Form 2 { 3 public
標籤:效果 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 WindowsFormsApplication1{ public partial class
標籤: 這幾天看《代碼大全》中的第十三章---不常見的資料類型,裡面講解到了C語言中的struct以及對指標的解釋,聯想到以前看過相關的關於C語言中stuct長度的文章,只是現在有些淡忘了,因此今天把儲存的資料重新拿出來溫習一遍,同時寫下這篇文章,對以前相關資料總結的同時順便梳理一下已有的知識。一、基礎資料型別 (Elementary Data
標籤:堆棧://// Created by mao on 16-9-16.//#ifndef UNTITLED_STACK_H#define UNTITLED_STACK_H#define TRUE 1#define FALSE 0typedef int STACK_TYPE;typedef struct stack{ STACK_TYPE value; struct stack *next;} STACK;void create_stack();void