From 3b2edaab43062903d8e4a18a46ae64a91905782f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A8=81=E5=8B=9D=20=E5=BC=B5?= Date: Sat, 2 Mar 2024 14:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=A9=A2=E6=9C=89?= =?UTF-8?q?=E7=84=A1=E8=A7=80=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Parking_spaces/Controllers/EngineeringController.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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()