LoginForm - Try catch exception while init ApiController
This commit is contained in:
parent
bbe0f7ed64
commit
53f457b020
|
@ -1,4 +1,5 @@
|
||||||
using System.Drawing;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
@ -34,7 +35,15 @@ namespace AIParkingApplication
|
||||||
return;
|
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;
|
lblLoginStatus.Text = string.Empty;
|
||||||
string username = txtUsername.Text;
|
string username = txtUsername.Text;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using OpenCvSharp;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user