Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in my code i have 3 urls.when i executing the values are passed in the urls..after some time got an error .

The remote server returned an error: (406) Not Acceptable..

my code

C#
foreach (Eben_Longcode_Manager_V3.Classes.ShortMessage msg in objShortMessageCollection)
                {
                    msg1 = msg.Message.Replace("'", " ");
                    string st = msg1.Substring(msg1.Length - 2, 2);
                    if (st == "OK")
                        msg1 = (msg1.Remove(msg1.Length - 3)).Trim();
                    msg1 = System.Web.HttpUtility.UrlEncode(msg1.ToString());
                    //string query = "INSERT INTO long_msg(num,msg,date) VALUES('" + msg.Sender.ToString() + "', '" + msg1 + "','" + DateTime.Now.ToString("MM/dd/yyyy").ToString() + "')";
                    //MySqlCommand cmd = new MySqlCommand(query, connection);
                    //cmd.ExecuteNonQuery();                        
                    string no = msg.Sender.ToString().Replace("+", "");
                    string url = "http://traffic.ebentelecom.co.in/WldKbGJuUnlZV1ptYVdNPQ.php?msg=" + msg1 + "&mob=" + no + "&route=Longcode&sim=" + mob;
                    string url1 = "http://www.trafficmanager.in/WldKbGJuUnlZV1ptYVdNPQ.php?msg=" + msg1 + "&mob=" + no + "&route=Longcode&sim=" + mob;
                    string url2 = "http://airtel.ebentelecom.com/airtel_longcode.php?mobile=" + no + "&message=" + msg1;
                    using (WebClient client = new WebClient())
                        client.DownloadString(url);
                    using (WebClient client1 = new WebClient())
                        client1.DownloadString(url1);
                    using (WebClient client2= new WebClient())
                        client2.DownloadString(url2);
                    System.Threading.Thread.Sleep(500);
                    msg_read = msg_read + 1;
Posted
Comments
[no name] 3-May-14 1:25am    
Okay.... and?
Rini Rajan 5-May-14 1:45am    
Hai wes Aday,
in my code..the first url work fine..when it come into the 2nd url.got yhe error The "remote server returned an error: (406) Not Acceptable"

1 solution

 
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