私はプラムツリーを初めて使用し、プラムツリー オブジェクト モデルを理解しようとしています。プラムツリー ナレッジ ディレクトリからプログラムでファイルをダウンロードしようとしています。
これは私が使用しているコードです:
IRemoteSession session = RemoteSessionFactory.GetExplicitLoginContext(new Uri(url), userName, password);
IDocumentFolderManager DocFolderManager = session.GetDocumentFolderManager();
IDocumentManager DocManager = session.GetDocumentManager();
IObjectQuery FolderQuery = DocFolderManager.GetSubFolders(folderID);
IDocumentQuery DocQuery = DocManager.CreateQuery(FolderQuery.GetRow(i).GetID());
IObjectQuery DocumentQuery = DocQuery.Execute();
IObjectQueryRow document = DocumentQuery.GetRow(1);
IDocumentProperties _docProperties = DocManager.QueryDocumentProperties(document.GetID());
string docUrl = _docProperties.GetStringValue(5);
WebClient webclient = new WebClient();
webclient.Credentials = new System.Net.NetworkCredential(userName, password, "");
webclient.Credentials = CredentialCache.DefaultCredentials;
webclient.DownloadFile(docUrl, "c:\1");
しかし、セッション作成コードに問題があるようです。実際のファイルをダウンロードする代わりに、このコードは Plumtree ログイン ページをファイル システムにダウンロードするからです。
誰かが私がここで間違っていることを教えてもらえますか? 私が見逃している何かがあるに違いない