List <Person> person = new List <Person>(); Person p1 = new Person("張三", 26, Gender.Male, "看書"); Person p2 = new Person("張四", 55, Gender.Male, "釣魚"); List <Student> stu = new List <Student>(); Student s1 = new Student("李四", 26
http://support.microsoft.com/default.aspx?scid=kb;EN-US;326176HOW TO: Implement a DataSet SELECT DISTINCT Helper Class in Visual C# .NETView products that this article applies to.Article ID:326176Last Review:February 8, 2007Revision:3.1This article
private static void EndGetStreamCallback(IAsyncResult ar){ FtpState state = (FtpState) ar.AsyncState; Stream requestStream = null; // End the asynchronous call to get the request stream. try { requestStream = state.Request.EndGe
1.首先引入System.Runtime.InteropServices using System.Runtime.InteropServices; 2.在類內部聲明兩個API函數,它們的位置和類的成員變數等同.[System.Runtime.InteropServices.DllImport("user32.dll")] //申明API函數 public static extern bool ReGISterHotKey(IntPtr hWnd, // handle to window
///<summary>/// This mehtod retrieves the excel sheet names from /// an excel workbook./// </summary>/// <param name="excelFile">The excel file.</param>/// <returns>String[]</returns>private String[]
string s = "<FORM id=logInForm name=logInForm action=chk_rule.php method=post><INPUT type=hidden value=nf3a5776z23th8npzppq54z1j0d9z032 name=uid> </FORM>";Regex re = new Regex(@"\s+value=([^\s>]+)");Match m = re.Match(s);if
事件通知是最佳方案,以前用一個while(xxx)來等待,後來發現會有一些問題:using System;using System.Text;using System.Windows.Forms;using System.Threading;namespace WindowsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComp
有時候我們調用一個第三方的會阻塞的方法,我們要想法做一個調用逾時值,一般來說就是另起一個線程加join的辦法,這裡有另外一種思路,但也不是完全的解決辦法,希望大家多多討論。下面是咱們的一個方法,很簡單,一個執行方法,一個終止方法,一個和執行方法簽名相同的公開委託。class MyHelper{ public delegate int ExecuteDelegate(int a); volatile bool _stopFlag = false; public int Execu
net框架頁中自動插入資料 ,網上搜集了一些資料首先對webBrowser載入網頁Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->this.webBrowser1.Url = new System.Uri("url地址", System.UriKind.Absolute);給一般不是框架頁中的文字框賦值Code highlighting
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System.IO;using System.Text;using System.Text.RegularExpressions;using System.Net; 1.先取得網頁的原代碼Code highlighting produced by Actipro