回家在看~
http://big5.webasp.net/article/15/14889.htm
http://msdn.microsoft.com/en-us/library/ff650316.aspx
imagefish 發表在 痞客邦 留言(0) 人氣(30)
// 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) 人氣(20)
http://www.csharpwin.net/ddwstp/net/csharp/5723dr4312.shtml
簡單明瞭不囉嗦。這段威威..~"~
=====重點整理一下關於綁定自己設定的DataType方法====
imagefish 發表在 痞客邦 留言(0) 人氣(30)
// 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) 人氣(4)
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) 人氣(23)
// 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) 人氣(0)
class ListInit
{
static void Main(string[] args)
{
// The demo of List Initialize Set including old declaration and new declaration(C#3.0)
// Old initialization.
List stringOld = new List();
stringOld.Add("string_1");
stringOld.Add("string_2");
// New initialization.
List stringNew = new List()
{
"string_1",
"string_2"
};
// Combine Object and List Init.
List list = new List{
new Contact{
LastName = "Alen",
DateOfBirth = new DateTime(1234,1,13)
},
new Contact{
LastName = "AlenTwo",
DateOfBirth = new DateTime(2345,1,23)
}
};
}
private class Contact
{
public string LastName { get; set; }
public DateTime DateOfBirth { get; set; }
}
}
imagefish 發表在 痞客邦 留言(0) 人氣(22)
class Program
{
static void Main(string[] args)
{
// The demo of Object Initialize Set including old declaration and new declaration(C#3.0)
// If member access modifier isn't declared as "public", method_1 and method_2 isn't working.
// method_1
Contact contact = new Contact();
contact.LastName = "A-len";
contact.DateOfBirth = new DateTime(2012, 04, 03);
//method_2
Contact contactNew = new Contact
{
LastName = "A-len",
DateOfBirth = new DateTime(2012, 04, 03)
};
}
private class Contact
{
public string LastName { get; set; }
public DateTime DateOfBirth { get; set; }
}
}
imagefish 發表在 痞客邦 留言(0) 人氣(24)

阿好像很久沒寫了...(搔頭)。從韓國回來以後中間經歷了短暫的軍事訓練以後就投入到Gamania的大家庭了...,然後就忙到忘記把最後兩天的部份給補齊 = =++
。趁這個228連假的空檔,機會一鼓作氣地寫完吧!!!
imagefish 發表在 痞客邦 留言(0) 人氣(77)
StreamReader defaults to UTF-8 encoding unless specified otherwise, instead
of defaulting to the ANSI code page for the current system.
(Hint: Convert xls/xlsx file to csv file. the encoding is ANSI.)
imagefish 發表在 痞客邦 留言(0) 人氣(87)