远程服务器返回错误:(406)Not Acceptable [英] The remote server returned an error: (406) Not Acceptable
本文介绍了远程服务器返回错误:(406)Not Acceptable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的代码中我有3个urls.when我执行的值是在url中传递的..有些时候出错了。
远程服务器返回错误:(406)不可接受..
我的代码
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(查询,连接);
// cmd.ExecuteNonQuery();
string no = msg.Sender.ToString()。替换( +, );
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;
使用(WebClient客户端= 新 WebClient())
client.DownloadString( URL);
使用(WebClient client1 = new WebClient())
client1.DownloadString( URL1);
使用(WebClient client2 = new WebClient())
client2.DownloadString( URL2);
System.Threading.Thread.Sleep( 500 );
msg_read = msg_read + 1 ;
解决方案
这可能帮助您
http://www.checkupdown.com/ status / E406.html [ ^ ]
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
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;
解决方案
This may help you
http://www.checkupdown.com/status/E406.html[^]
这篇关于远程服务器返回错误:(406)Not Acceptable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文