<HTML Agility Pack(HAP) 介紹>
1.HTML Agility Pack:簡單好用的快速 HTML Parser

2.c#中的jQuery——HtmlAgilityPack

imagefish 發表在 痞客邦 留言(0) 人氣()

JSON.NET Sample
JSON deserialization with JSON.net


To help user to auto-convert json to c# data structure. 

imagefish 發表在 痞客邦 留言(0) 人氣()

1bbb
Step1:開啟一個專案(EX: console application)


Step2:如下圖操作(點選 Reference),選取 Add Web Service,會跳出一個視窗。該視窗是WCF設定視窗,不過我們需要用的是舊型的Web Service,所以點選左下角的按鈕(Advance)。
  

imagefish 發表在 痞客邦 留言(0) 人氣()

Tutorial
http://csharp.net-informations.com/excel/csharp-excel-tutorial.htm
 
The Simple method of use

imagefish 發表在 痞客邦 留言(0) 人氣()

睡前翻書翻到的。然後上msdn發現...嘿嘿,竟然沒講。
http://msdn.microsoft.com/zh-tw/library/14akc2c7(v=vs.100).aspx
這有點難用程式碼寫出來,不過我覺得應該用個...一些圖表示,有空在畫好了。
 // 預備畫圖...

imagefish 發表在 痞客邦 留言(0) 人氣()

http://msdn.microsoft.com/en-us/library/dd264739.aspx
msdn的說明。
先講 Optional Arguments(可選參數)應用在Method(方法)上,這功能就是幫你預設好參數(Arguments)值,當有輸入值的時候就聽遵循輸入值的話 ; 當沒有輸入值的時候就直接把預測值塞入。 這東西可以用Overload的寫法實作,但是程式碼將會壟長很多..。
 

imagefish 發表在 痞客邦 留言(0) 人氣()

當初是為了處理兩個Array / List 放在同一個For loop內一起使用,但是不想要改動到既有的程式碼而上網查的。(簡單來說本來功能都寫好了,但是我臨時發現忘記記錄一筆資料,但我List 的 Data struct都設計好了不想再更動他,所以想想有沒有比較偷懶的方法)
.Net 4.0推出這個東西其實還蠻不錯的.....雖然當下看會覺得這個Func真的是一點屁用都沒有,因為一般人不會那麼蠢把都要放到For loop中的資料拆成兩個Array。
不過站在這種奇妙的案例下這Func就蠻有用的...= =++
http://stackoverflow.com/questions/1955766/iterate-two-lists-or-arrays-with-one-foreach-statment-in-c-sharp

imagefish 發表在 痞客邦 留言(0) 人氣()

回家在整理。
http://stackoverflow.com/questions/5766573/in-c-what-is-the-best-way-to-compare-2-integer-lists-array
 
額外新增,List用法介紹。

imagefish 發表在 痞客邦 留言(0) 人氣()

回家在看~
 
http://big5.webasp.net/article/15/14889.htm
http://msdn.microsoft.com/en-us/library/ff650316.aspx

imagefish 發表在 痞客邦 留言(0) 人氣()

// Main function
class MainFunc
{
static void Main(string[] args)
{
string[] animals = new string[] { "Koala", "Spider", "Elephant" };
wherepractice prac = new wherepractice();
// get animals of StartName is "S"
prac.detailWhere(animals);
// get amimals of StartName is "E"
prac.lambdaWhere(animals);
// as above result, but different implement.
prac.delegateImpleWhere(animals);
Console.ReadLine();
return;
}
}

imagefish 發表在 痞客邦 留言(0) 人氣()

// Main function
class MainFunc
{
static void Main(string[] args)
{
string[] animals = new string[] { "Koala", "Spider", "Elephant" };
wherepractice prac = new wherepractice();
// get animals of StartName is "S"
prac.detailWhere(animals);
// get amimals of StartName is "E"
prac.lambdaWhere(animals);
// as above result, but different implement.
prac.delegateImpleWhere(animals);
Console.ReadLine();
return;
}
}

imagefish 發表在 痞客邦 留言(0) 人氣()

This is a simple sample for Exit statement.
static void Main(string[] args)
{
Program.correctGoto();
Program.GotoInfiniteLoop();
Program.falseGoto();
}

//This is a correct Goto statement method.
static public void correctGoto()
{
for (int i = 0; i < 100; i++)
{
Console.WriteLine("{0}", i);
if (i == 5)
{
goto Exit;
}
}
Exit: Console.WriteLine("Exit");
}

//If you put Exit tag before goto statement, it will cause infinite loop.p>
static public void GotoInfiniteLoop()
{
Exit: Console.WriteLine("Exit");

for (int i = 0; i < 100; i++)
{
Console.WriteLine("{0}", i);
if (i == 7)
{
goto Exit;
}
}

}

//It's a wrong method to use exit statement.
static public void falseGoto()
{
for (int i = 0; i < 100; i++)
{
Console.WriteLine("{0}", i);
if (i == 7)
{
Exit: Console.WriteLine("Exit");
}
// this method can't jump from external into internal.
goto Exit;
}
}

imagefish 發表在 痞客邦 留言(0) 人氣()

1 2
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。