Time of Update: 2016-05-20
標籤: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;using System.Xml;using System.IO;namespace WindowsFormsApplication1{
Time of Update: 2016-05-20
標籤:後台代碼: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)  
Time of Update: 2016-05-18
標籤:web api寫api介面時預設返回的是把你的對象序列化後以XML形式返回,那麼怎樣才能讓其返回為json呢,下面就介紹兩種方法: 方法一:(改配置法) 找到Global.asax檔案,在Application_Start()方法中添加一句: 代碼如下:GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();修改後: 代碼如下:protected
Time of Update: 2016-05-18
標籤:轉載原出處: http://blog.csdn.net/honantic/article/details/46331875匿名函數 匿名函數(Anonymous
Time of Update: 2016-05-18
標籤:索引器允許類或者結構的執行個體按照與數組相同的方式進行索引取值,索引器與屬性類似,不同的是索引器的訪問是帶參的。索引器和數組比較:(1)索引器的索引值(Index)類型不受限制(2)索引器允許重載(3)索引器不是一個變數索引器和屬性的不同點(1)屬性以名稱來標識,索引器以函數形式標識(2)索引器可以被重載,屬性不可以(3)索引器不能聲明為static,屬性可以 一個簡單的索引器例子using System;using System.Collections;public
Time of Update: 2016-05-12
標籤:protected void Button1_Click(object sender, EventArgs e) { if (Directory.Exists(Server.MapPath("~/upimg/hufu")) == false)//如果不存在就建立file檔案夾 {
Time of Update: 2016-05-17
標籤: 1 WMI CLASS 2 3 // 硬體 4 Win32_Processor, // CPU 處理器 5 Win32_PhysicalMemory, // 實體記憶體條 6 Win32_Keyboard, // 鍵盤 7 Win32_PointingDevice, // 點輸入裝置,包括滑鼠。 8 Win32_FloppyDrive, // 軟碟機 9 Win32_DiskDrive, // 硬碟 10 Win32_CDROMDrive, // 光碟片磁碟機 11
Time of Update: 2016-05-17
標籤:Ⅰ.抽象類別 1.抽象類別、抽象方法 抽象類別:通常情況下,它裡面有抽象方法,類前面定義了一個abstract 抽象方法:只定義了方法的名稱,沒有定義方法的內容 2.為什麼要使用抽象類別、抽象方法? 都是為了繼承 3. 怎麼去定義抽象類別,抽象方法?
Time of Update: 2016-05-11
標籤: 應用程式及使用者佈建在設計時建立新設定的步驟 在“Solution Explorer”(方案總管)中,展開項目的“Properties”(屬性)節點。在“Solution Explorer”(方案總管)中,雙擊要在其中添加新設定的 .settings 檔案。此檔案的預設名稱是
Time of Update: 2016-05-11
標籤:轉自:http://outofmemory.cn/code-snippet/1762/C-how-control-method-zhixingshijian-chaoshi-ze-force-quit-method-execution/comments1 有時候我們需要控制方法的執行時間,如果逾時則強制退出。要控制執行時間,我們必須使用非同步模式,在另外一個線程中執行方法,如果逾時,則拋出異常終止線程執行。如下實現的方法:class Program{
Time of Update: 2016-05-09
標籤:lock 的目的很明確:就是不想讓別人使用這段代碼,體現在多線程情況下,只允許當前線程執行該代碼地區,其他線程等待直到該線程執行結束;這樣可以多線程避免同時使用某一方法造成資料混亂。一般定義如下:private static readonly object obj = new object();lock(obj){‘‘‘代碼塊} MSDN給出:我們lock的一般是對象,不是數值和字串。 1、為什麼不能lock實值型別 比如lock(
Time of Update: 2016-05-11
標籤:namespace WebBrowserMemoryTest{ public partial class Form1 : Form { private int _Pages; public Form1() { InitializeComponent(); webBrowser1.Navigate("http://www.google.com"); }
Time of Update: 2016-05-09
標籤:使用static來定義變數和到期時間 //===================== 初始化待用資料 ========================== #region private static DateTime TokenExpTime = DateTime.Now.AddDays(-5); //Access_Token到期時間 private static string Access_Token = "";
Time of Update: 2016-05-12
標籤:1、瞭解C#集合System.Collections 命名空間System.Collections 命名空間包含介面和類,這些介面和類定義各種對象(如列表、隊列、位元組、雜湊表和字典)的集合。類 類說明ArrayList使用大小可按需動態增加的數組實現 IList 介面。BitArray管理位值的壓縮數組,該值表示為布爾值,其中 true 表示位是開啟的 (1),false 表示位是關閉的
Time of Update: 2016-05-13
標籤: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;using System.IO;namespace boxs{ public partial class Form1 : Form
Time of Update: 2016-05-20
標籤:編譯器 c語言 extern "c"的主要作用就是為了能夠正確實現C++代碼調用其它C語言代碼。加上extern "c"後,會指示編譯器這部分代碼按照C語言的風格進行編譯。
Time of Update: 2016-05-14
標籤:package lianxi;import java.util.*;public class Xvexichengji { public static void main(String[] args) { System.out.println("輸入姓名"); Scanner xingming = new Scanner(System.in); String ren = xingming.next();
Time of Update: 2016-05-13
標籤: 今天來學習下I2C通訊~ I2C(Inter-Intergrated Circuit)指的是 IC(Intergrated Circuit)之間的(Inter) 通訊方式。如所以有很多的周邊裝置都是用I2C通訊方式進行通訊的。 I2C(Inter-Intergrated Circuit)通訊使用Clock
Time of Update: 2016-05-13
標籤:Problem hereProblemDrazil is playing a math game with Varda.Let’s define for positive integer x as a product of factorials of its digits. For example, First, they choose a decimal number a consisting of n digits that contains at least one digit
Time of Update: 2016-05-12
標籤:題目連結:點這裡!!!題意:輸入n(n<=2e5),q(q<=2e5)。緊接著輸入n個數a1~an(ai<=5e5)。給定一個空集合。針對每個q,輸入x,如果a[x]在不在集合裡面,將a[x]插入進去,並且求當前該集合中有多少對互質的數;如果a[x]在集合裡面,將a[x]刪除,並且求當前該集合有多少對互質的數。題解:1、 將所有數的素因子求出來。(最多6個)2、如果將a[x]插入進去,我們檢查由a[x]的素因子能組成的數有哪些,全部+1。