2019年6月10日 星期一

應用程式避免執行多個實體

若已執行則不再執行
private void Form1_Load(object sender, EventArgs e) {
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) Application.Exit();
}

沒有留言:

自訂權限驗證機制

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