diff --git a/AIParkingApplication/LoginForm.cs b/AIParkingApplication/LoginForm.cs index 1da2e9b..2f03517 100644 --- a/AIParkingApplication/LoginForm.cs +++ b/AIParkingApplication/LoginForm.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System; +using System.Drawing; using System.IO; using System.Windows.Forms; @@ -34,7 +35,15 @@ namespace AIParkingApplication return; } - apiController = new ApiController(txtServerAddress.Text); + try + { + apiController = new ApiController(txtServerAddress.Text); + } + catch (Exception ex) + { + MessageBox.Show($"Cấu máy chủ lỗi - Kiểm tra lại tên máy chủ, kết nối máy chủ! \r\n {ex.Message}", "Lỗi khởi tạo API!", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } lblLoginStatus.Text = string.Empty; string username = txtUsername.Text; diff --git a/AIParkingApplication/Util.cs b/AIParkingApplication/Util.cs index 3fa948e..53106f4 100644 --- a/AIParkingApplication/Util.cs +++ b/AIParkingApplication/Util.cs @@ -1,10 +1,8 @@ using Newtonsoft.Json; -using OpenCvSharp; using System; using System.Diagnostics; using System.Drawing; using System.IO; -using System.Net.Http; using System.Net.NetworkInformation; using System.Text.RegularExpressions; using System.Threading.Tasks;