我在参考资料用C#编写一个检测邮箱未读邮件的数量的时候,发现资料上用 MSXML2.XMLHTTP30 ,但我在编写的时候只有 MSXML2.XMLHTTP26可以使用,但程序运行到这里时就发生异常.我想请教一下MSXML2.XMLHTTP30和MSXML2.XMLHTTP26有什么区别,如何才能让我的环境下也能使用MSXML2.XMLHTTP30?谢谢
string tagdata = "version=" + "\"1.0\"";
string strURL = "http://192.168.0.9/Exchange/administrator";
//MessageBox.Show(tagdata);
pi = doc.createProcessingInstruction("xml", tagdata);
doc.appendChild(pi);
node = doc.createNode(1, "searchrequest", "DAV:");
//pi.appendChild(node);
doc.documentElement = (MSXML2.IXMLDOMElement)node;
node2 = doc.createNode(1, "sql", "DAV:");
node.appendChild(node2);
string strquery = "SELECT \"dav:displayname\", \"urn:schemas:mailheader:textdescription\" FROM scope('shallow traversal of \"http://192.168.0.9/Exchange/administrator \"') WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = true";
query = doc.createTextNode(strquery);
node2.appendChild(query);
MSXML2.XMLHTTP26 req = new MSXML2.XMLHTTP26Class();//MSXML2.XMLHTTP30 req = new MSXML2.XMLHTTP30Class();
object objperson = "dev\\domine\administrator";
object objpass = "";
req.open("SEARCH", strURL, false, objperson, objpass);