源代码:
MSXML2.XMLHTTP30Class myHttp=new MSXML2.XMLHTTP30Class();

string strUrl="http://192.168.0.219:8080/dsmp/UnSubscribe?spserviceid=-FCSSBY&feeuserid=13888946427&destuserid=13888946427";
myHttp.open("get",strUrl,false,"","");
myHttp.send("");
if(myHttp.status==200)
  {
    if(myHttp.readyState==4)
{
string strHtml="";
string strHtmlTotal=myHttp.responseText.ToString();
}
  }上面的程序语法没问题,调试通过了,可怎么监控中的myHttp报以下错误:- myHttp {MSXML2.XMLHTTP30Class} MSXML2.XMLHTTP30Class
System.Object {MSXML2.XMLHTTP30Class} System.Object
readyState 1 int
responseBody <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> System.Object
responseStream <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> System.Object
responseText <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string
- responseXML {System.__ComObject} System.Object
- [System.__ComObject] {System.__ComObject} System.__ComObject
- System.MarshalByRefObject {System.__ComObject} System.MarshalByRefObject
System.Object {System.__ComObject} System.Object
__identity <未定义的值> System.Object
m_ObjectToDataMap <未定义的值> System.Collections.Hashtable
m_wrap 2043256 int
status <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> int
statusText <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> string

解决方案 »

  1.   

    这个我没用过
    你把myHttp.send("");改成myHttp.send();试试不行的话可以考虑换成下面的代码string strUrl="http://192.168.0.219:8080/dsmp/UnSubscribe?spserviceid=-FCSSBY&feeuserid=13888946427&destuserid=13888946427";
        
    WebRequest webr=WebRequest.Create(strUrl); 
    Stream rc=webr.GetResponse().GetResponseStream(); 
    StreamReader read=new StreamReader(rc,System.Text.Encoding.Default); 
    string strHtml="";
    string strHtmlTotal=read.ReadToEnd();
      

  2.   

    我也遇到同样的问题,代码如下:
    QueryEng.aspx?querytext=S&amp;TotalResults=true输出的是XML文件, MSXML2.IXMLHTTPRequest xmlRequest = new MSXML2.XMLHTTPClass();
    xmlRequest.open("GET","QueryEng.aspx?querytext=S&amp;TotalResults=true",false,null,null);
    xmlRequest.send(null);
    string xml = xmlRequest.responseText;
    未指定的错误 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Runtime.InteropServices.COMException: 未指定的错误错在那里了呢?