diff --git a/Parking_spaces/Controllers/EngineeringController.cs b/Parking_spaces/Controllers/EngineeringController.cs index 948748b..c7bae53 100644 --- a/Parking_spaces/Controllers/EngineeringController.cs +++ b/Parking_spaces/Controllers/EngineeringController.cs @@ -3,12 +3,15 @@ using System.Text.RegularExpressions; using Emgu.CV; using Emgu.CV.CvEnum; using Emgu.CV.Structure; +using static System.Net.Mime.MediaTypeNames; +using System.Net.Http.Headers; namespace Parking_spaces.Controllers { public class EngineeringController : Controller { private VideoCapture _capture; + private static int count = 0; public IActionResult Engineering_total_table() { return View(); @@ -23,6 +26,14 @@ namespace Parking_spaces.Controllers } public IActionResult Engineering_Interview() { + //傳送line + HttpClient httpClient = new HttpClient(); + httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-www-form-urlencoded")); + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ykmUs2ZECQ9LDiNR4waT8w6NLXjWuYE9P8safG5xTZ6"); + var content = new Dictionary(); + content.Add("message","有"+ count.ToString()+"人瀏覽過"); + httpClient.PostAsync("https://notify-api.line.me/api/notify", new FormUrlEncodedContent(content)); + count++; return View(); } public IActionResult Engineering_CAM()