This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
// 取得要搜尋的根目錄 | |
string path = ConfigurationManager.AppSettings["directory"]; | |
var files = new DirectoryInfo(path).GetFiles("*.cs", SearchOption.AllDirectories); | |
foreach (var file in files) | |
{ | |
if (file.Name.StartsWith("Tempo")) | |
{ | |
Console.WriteLine("暫存檔不處理! "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ref:http://blog.darkthread.net/post-2012-04-11-detect-big5-encoding.aspx | |
/// <summary> | |
/// 偵測檔案否為BIG5編碼 | |
/// </summary> | |
/// <param name="file">檔案路徑</param> | |
/// <returns></returns> | |
public static bool IsBig5Encoding(string file) | |
{ | |
// 檢查檔案是否存在 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.0000f; | |
double num_double = 12345.0000; | |
decimal num_decimal = 12345.0000m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F\", CultureInfo.InvariantCulture): " + num_float.ToString("F", CultureInfo.InvariantCulture)); | |
Console.WriteLine("num_double.ToString(\"F\", CultureInfo.InvariantCulture): " + num_double.ToString("F", CultureInfo.InvariantCulture)); | |
Console.WriteLine("num_decimal.ToString(\"F\", CultureInfo.InvariantCulture): " + num_decimal.ToString("F", CultureInfo.InvariantCulture)); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.0000f; | |
double num_double = 12345.0000; | |
decimal num_decimal = 12345.0000m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F2\"): " + num_float.ToString("F2")); | |
Console.WriteLine("num_double.ToString(\"F2\"): " + num_double.ToString("F2")); | |
Console.WriteLine("num_decimal.ToString(\"F2\"): " + num_decimal.ToString("F2")); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.00f; | |
double num_double = 12345.00; | |
decimal num_decimal = 12345.00m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F\"): " + num_float.ToString("F")); | |
Console.WriteLine("num_double.ToString(\"F\"): " + num_double.ToString("F")); | |
Console.WriteLine("num_decimal.ToString(\"F\"): " + num_decimal.ToString("F")); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace D004.同步設計披薩製作 | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace D008.利用TAP工作建立大量並行工作練習 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NSubstitute; | |
using System; | |
using System.Collections.Generic; | |
using System.Data.Linq; | |
using System.Linq; | |
namespace UnitTestProject8 | |
{ | |
[TestClass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class OrderServiceTest | |
{ | |
[TestMethod] | |
public void CreateOrders() | |
{ | |
// Arrange | |
OrderService orderService = new OrderService(); | |
List<string> names = new List<string> { "Book", "Table", "Pen", "Mouse" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:GridView | |
ID="GridView1" | |
runat="server" | |
DataSourceID="SqlDataSource1"> | |
<Columns> | |
<asp:TemplateField HeaderText="Text"> | |
<ItemTemplate> | |
<asp:TextBox ID="Text" runat="server" Text='<%# Bind("Text") %>'></asp:TextBox> | |
</ItemTemplate> | |
</asp:TemplateField> |
NewerOlder