public HttpResponseMessage GetCaptcha() { ATISMobileWebApi WebAPi = new ATISMobileWebApi(); try { //تایید اعتبار کلاینت WebAPi.AuthenticateClientGetCaptcha(Request); var NSSSoftwareuser = WebAPi.GetNSSSoftwareUser(Request); var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager(); var InstanceCaptcha = new R2CoreInstanceCaptchaManager(); var CaptchaImage = InstanceCaptcha.GenerateCaptcha(InstanceSoftwareusers.GetCaptchaNumericforSoftwareUser(NSSSoftwareuser)); ImageRawData IImage = new ImageRawData(); IImage.IRawData = (new JsonImage(CaptchaImage)).GetRawData(); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(JsonConvert.SerializeObject(IImage), Encoding.UTF8, "application/json"); return response; } catch (Exception ex) { return WebAPi.CreateErrorContentMessage(ex); } }