2022年11月15日 星期二

epplus 設定儲存格為行動電話格式

  public static void 設定行動電話(this ExcelRange range, string 電話)
        {
            range.Value = 電話.ToInt64();
            range.Style.Numberformat.Format = "[>99999999]0000-000-000;000-000-000";
        }

 ws.Cells[rowindex, colindex].設定行動電話("0911222333"); => excel 顯示為 0911-222-333

沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...