Bhavesh Vankar

Bhavesh Vankar

  • 763
  • 1.1k
  • 87.9k

How to capture image by multiple computer and use

Nov 7 2020 1:13 AM
below is my code to capture image by webcam using asp.net c#. i want to make application which is using in multiple computer by server in same time capture image by multiple pc. how to make it.. kindly suggest me good code for it.
  1. [WebMethod()]  

  2.        public static bool SaveCapturedImage(string data)  
  3.        {  
  4.            string fileName = DateTime.Now.ToString("dd-MM-yy");  
  5.            //Convert Base64 Encoded string to Byte Array.  
  6.            byte[] imageBytes = Convert.FromBase64String(data.Split(',')[1]);  
  7.            //Save the Byte Array as Image File.  
  8.            string filePath = HttpContext.Current.Server.MapPath(string.Format("~/CapturedImage/{0}.jpg", fileName));  
  9.            File.WriteAllBytes(filePath, imageBytes);  
  10.            return true;  
  11.        }  

Answers (2)