远程服务器返回错误:(500)内部服务器错误。如何解决这个问题呢 [英] The remote server returned an error: (500) Internal Server Error. how to solve this problem

查看:1300
本文介绍了远程服务器返回错误:(500)内部服务器错误。如何解决这个问题呢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i used this coding in asp.net web application. may be the requestinng arguement(userid and password) is not correct format. i think this blow coding for consol application. how to send those arguement in asp.net web application ? or what is the problem?










public void functionname()
{

HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create("http://xxxxx/function.asmx/login");

myRequest.Method = "POST";

using (StreamWriter requestWriter = new StreamWriter(myRequest.GetRequestStream()))
{

requestWriter.Write("&{0}={1}", HttpUtility.UrlEncode("UserId"), HttpUtility.UrlEncode("christ"));

requestWriter.Write("&{0}={1}", HttpUtility.UrlEncode("Password"), HttpUtility.UrlEncode("christ123"));


}

using (StreamReader responseReader = new StreamReader(myRequest.GetResponse().GetResponseStream())) // here throws internal error. it is not going inside this function.
{

result = responseReader.ReadToEnd();

}

}





我收到如下错误:



远程服务器返回错误:(500)内部服务器错误。



如何解决此错误。



注意:我测试了普通方法helloworld(不发送争论或发送任何重新请求),一个不会遇到内部错误。但如果我只发送任何争论(用户ID,密码),它会抛出远程服务器返回错误:(500)内部服务器错误。



需要帮助。



I am getting error like below:

The remote server returned an error: (500) Internal Server Error.

how to solve this error.

Note : i tested normal method helloworld (which does not send arguement or sending any rerquest), that one does not face internal error. but if i send any arguement only(userid,password), it throws like " The Remote server returned an error:(500)Internal Server Error.

help needed.

推荐答案

你收到500错误,因为网络服务器上运行的代码以某种方式崩溃。你显然在你的请求中做了一些事情,服务器没有不喜欢,没想到,也不知道如何处理。
You're getting a 500 error back because the code running on the webserver crashes somehow. You apparently did something in your request that the server didn't like, didn't expect, and doesn't know how to handle.


这篇关于远程服务器返回错误:(500)内部服务器错误。如何解决这个问题呢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆