- Jan 30 Thu 2020 10:35
-
[C#]EMAIL寄送範例
- Oct 25 Fri 2019 10:52
-
[C#]一行把DataTable的資料轉為JSON
- Oct 25 Fri 2019 10:38
-
[C#]把UnixTime轉為Datetime
- Apr 22 Mon 2019 13:48
-
[C#]透過SOAP API取得資料並解析XML資料範例
透過公司ERP的SOAP API取得XML格式同仁資料,同步到client端
解析XML範例如下:
//開始執行更新員工資料作業
if (!String.IsNullOrEmpty(url) && !String.IsNullOrEmpty(nb))
{
if (!String.IsNullOrEmpty(url) && !String.IsNullOrEmpty(nb))
{
- Feb 27 Wed 2019 10:10
-
[C#]產生日期格式為yyyyMMdd的字串
這個寫法很常用到
for (int i = 0; i <= 100; i++)
{
string date = DateTime.Now.AddDays(i).ToString("yyyyMMdd", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Response.Write(date);
{
string date = DateTime.Now.AddDays(i).ToString("yyyyMMdd", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Response.Write(date);
- Feb 25 Mon 2019 16:00
-
[C#]SOAP XML解析範例
- Oct 05 Fri 2018 15:42
-
[C#]判斷字串是否含有中文
- Oct 05 Fri 2018 15:37
-
[Windows Form]更改DataGridView列的顏色
如標題,範例為巡覽整個DataGridView,如指定欄位沒有中文的話,把整列的顏色改為淡綠色
/// <summary>
/// 更新DataGridView ROW的顏色
/// </summary>
privatevoidUpdateRowColor()
/// 更新DataGridView ROW的顏色
/// </summary>
privatevoidUpdateRowColor()
- Oct 05 Fri 2018 15:31
-
[Windows Form]DataGridView把欄位移到指定的地方並選取
如題
dgv.CurrentCell=dgv.Rows[x].Cells[0];//把現行欄位移到指定的欄位
dgv.Rows[x].Selected = true; //把該筆資料選取
dgv.Rows[x].Selected = true; //把該筆資料選取
- Oct 05 Fri 2018 15:27
-
[C#]判斷字串是否是英文
判斷字串是否是英文的method
/// <summary>
/// 判斷字串是否是大寫英文字母,是=>回傳true,否=>回傳false
/// </summary>
/// <param name="str"></param>
/// 判斷字串是否是大寫英文字母,是=>回傳true,否=>回傳false
/// </summary>
/// <param name="str"></param>
- Apr 26 Thu 2018 14:26
-
[ASP.NET]泛型處理常式ashx接收binary stream後轉給client
最近工作遇到的問題,
撰寫一支ashx擔任外網APP與內網NAS檔案串接的橋梁,
接收到NAS的Binary Stream後要再輸出給APP接收,
sample code如下 :
String NAS_API_URL = Utility.GetNASURL();
- Mar 31 Sat 2018 14:23
-
[C#]使用關鍵字從目錄中過濾擋案
如標題,
這是一個很常使用到的技巧,例如一個資料夾中有很多的CSV擋案(舉例),
但批次程式只需要對ABC開頭的擋案做處理,這時候就可以使用下面的程式碼過濾出要處理的擋案名稱。
privatestatic String csvFilePath = ConfigurationManager.AppSettings["CsvFilePath"].ToString();
String[] dirs = Directory.GetFiles(csvFilePath, "ABC*");//過濾出該目錄內ABC開頭的所有檔名
String[] dirs = Directory.GetFiles(csvFilePath, "ABC*");//過濾出該目錄內ABC開頭的所有檔名