Below is my method to capture image by web cam using c#
Its working but i want to host this in server and use it by multiple computer in same time. Its generate error image is used by another process and second issue is how to use this code for multiple computer if use this application by multiple users.
[WebMethod()]
public static bool SaveCapturedImage(string data)
{
string fileName = DateTime.Now.ToString("dd-MM-yy_hh-mm");
//.Replace("/", "-").Replace(" ", "_").Replace(":", "");
//Convert Base64 Encoded string to Byte Array.
byte[] imageBytes = Convert.FromBase64String(data.Split(',')[1]);
//Save the Byte Array as Image File.
string filePath = HttpContext.Current.Server.MapPath(string.Format("~/CapturedImage/{0}.jpg", fileName));
File.WriteAllBytes(filePath, imageBytes);
return true;
}