Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this error is coming
The method or operation is not implemented.



on
throw new NotImplementedException();


What I have tried:

i am trying to create coding for SMS integration with API of SMS.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;



namespace WebApplication31
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        string MyUsername = "923228279278"; //Your Username At Sendpk.com 
        string MyPassword = "4379"; //Your Password At Sendpk.com 
        string toNumber = "923228279278"; //Recepient cell phone number with country code 
        string Masking = "SMS Alert"; //Your Company Brand Name 
        string MessageText = "SMS Sent using .Net";
        string jsonResponse = SendSMS ("Masking", "toNumber", "MessageText"," MyUsername", "MyPassword");

        private static string SendSMS(string p1, string p2, string p3, string p4, string p5)
        {
            throw new NotImplementedException();
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            String URI = "http://Sendpk.com" +
            "/api/sms.php?" +
            "username=" + MyUsername +
            "&password=" + MyPassword +
            "&sender=" + Masking +
            "&mobile=" + toNumber +
            "&message=" + Uri.UnescapeDataString(MessageText); // Visual Studio 10-15 
            //"&message=" + System.Net.WebUtility.UrlEncode(MessageText);// Visual Studio 12 
            try
            {
                WebRequest req = WebRequest.Create(URI);
                WebResponse resp = req.GetResponse();
                var sr = new System.IO.StreamReader(resp.GetResponseStream());
                //return sr.ReadToEnd().Trim(); 
            }
            catch (WebException ex)
            {
                var httpWebResponse = ex.Response as HttpWebResponse;
                if (httpWebResponse != null)
                {
                    switch (httpWebResponse.StatusCode)
                    {
                        case HttpStatusCode.NotFound:
                        //return "404:URL not found :" + URI; 
                        //break; 
                        case HttpStatusCode.BadRequest:
                        //return "400:Bad Request"; 
                        //break; 
                        default:
                            break;
                       //return httpWebResponse.StatusCode.ToString(); 

                    }
                }
                //return null; 
            }
        }
    }
}
Posted
Updated 9-May-18 0:22am

1 solution

That SendSMS method is called in your

string jsonResponse =


line. Remove that line as you don't seem to need it. Any time you call SendSMS you'll get that exception because that is the exception the method is throwing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900