exchange 环境正常,能正常收发邮件 但是,尝试用webdav 与exchange 通信的时候,报了一个错误:未找到提供程序。该程序可能未正确安装 找了半天不知道哪里出错了
public static void TestGetMail() { ADODB.Connection oCn = null; ADODB.Recordset oRs = null; ADODB.Fields oFields = null; ADODB.Field oField = null; string sFdUrl = "http://192.168.253.193/exchange/Administrator/收件"; try { oCn = new ADODB.Connection(); oRs = new ADODB.Recordset(); oCn.Provider = "exoledb.datasource"; oCn.Open(sFdUrl, "administrator", "1qaz2WSX", -1);//error : 未找到提供程序。该程序可能未正确安装 string strSql; strSql = ""; strSql = "select "; strSql = strSql + " \"urn:schemas:mailheader:content-class\""; strSql = strSql + ", \"DAV:href\" "; strSql = strSql + ", \"" + SqlFieldName.DisplayName + "\""; strSql = strSql + ", \"" + SqlFieldName.MId + "\""; strSql = strSql + ", \"" + SqlFieldName.Subject + "\""; strSql = strSql + " from scope ('shallow traversal of " + "\""; strSql = strSql + sFdUrl + "\"') "; strSql = strSql + " WHERE \"DAV:ishidden\" = false"; strSql = strSql + " AND \"DAV:isfolder\" = false"; oRs.Open(strSql, oCn, ADODB.CursorTypeEnum.adOpenUnspecified, ADODB.LockTypeEnum.adLockOptimistic, 1); Console.WriteLine(3); if (!oRs.EOF) { oRs.MoveFirst(); } } catch (Exception e) { Console.WriteLine("出错了"); WriteLog(e.ToString()); } Console.ReadKey(); }
exoledb.datasource 这个东西 不支持 远程调用,需要将 程序部署到exhcanserver上去
|