コード例 #1
0
 protected void onRestAsyncClick(object sender, EventArgs e)
 {
     const string    username   = "******";
     const string    password   = "******";
     const string    from       = "5000...";
     const string    to         = "09123456789";
     const string    text       = "تست وب سرویس ملی پیامک";
     const bool      isFlash    = false;
     RestClientAsync restClient = new RestClientAsync(username, password);
     var             result     = restClient.SendAsync(to, from, text, isFlash);
 }
コード例 #2
0
        public async Task <ActionResult> RestAsync()
        {
            const string    username   = "******";
            const string    password   = "******";
            const string    from       = "5000...";
            const string    to         = "09123456789";
            const string    text       = "تست وب سرویس ملی پیامک";
            const bool      isFlash    = false;
            RestClientAsync restClient = new RestClientAsync(username, password);
            var             result     = await restClient.SendAsync(to, from, text, isFlash);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }