Hi guys,

I have a code that sends sms through clickatell gateway, but now I am getting the NotSupportedException with the message "this stream does not support seek operations". Anyone who has used clickatell gateway for sms successfully please help me.

Please help me eliminate this exception and get my code working.
here is my code:

client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR" +
                "1.0.3705;)");
              
                client.QueryString.Add("user", "*****");
                client.QueryString.Add("password", "******");
                client.QueryString.Add("api_id", "******");
                client.QueryString.Add("to", sms);
                client.QueryString.Add("text", "A new tender is uploaded, visit our website");
                string baseurl = "http://api.clickatell.com/http/sendmsg";
                System.IO.Stream data = client.OpenRead(baseurl); //I get the exception after this line
                
                System.IO.StreamReader reader = new System.IO.StreamReader(data);
                string s = reader.ReadToEnd();
                //data.Close();
                //reader.Close();
                return ;

Thanks,:confused:

You should NEVER post usernames/passwords or the like on the web. If you construct the URL from your code sample anyone in the world can with this information send text messages: http://api.clickatell.com/http/sendmsg?user=ditshego&password=khanyala1&api_id=3092895&to=55543651&text=Testing+the+url

You should imediatly change your password for this site before someone else hijacks your account.

commented: Great advice :) +36
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.