【发布时间】:2013-12-17 11:13:03
【问题描述】:
我需要关注:
在我的应用程序中,我有文件。需要随时检查的文件。当我从我的应用程序中签出文档时,我需要将自定义属性添加到文件中,以便稍后在我要签入文档时识别它。
我尝试使用以下代码使用 DSOFile 中的 OleDocumentProperties,但没有成功:
// Adding custom properties to file (Parameters: FileName, custom property name, value, debug: true/false
DocumentProperties.WriteDocumentProperty(filename, "dms_dossiernummer", _dossiernummer.ToString(), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_zaaknaam", ReturnZaaknaam(_dossiernummer), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_verantw_medew", ReturnVerantwMedew(_dossiernummer), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_document_path", path, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestandsnaam", bestandsNaam, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_id", bestandId, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_is_checkedout", "true", false);
DocumentProperties.WriteDocumentProperty(filename, "dms_dossier_map_id", dossierMapId, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestand_versie_nummer", Queries.Dms.Selects.GetDocumentVersion(
Convert.ToInt32(bestandId)).ToString(), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_locatie", path, false);
有谁知道将自定义文件属性添加到文件的另一种方法?
【问题讨论】:
-
上下文是什么?共享点?你谈到签入文件。在哪里检查?
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
@JohnSaunders 它用于 C# 应用程序。我正在构建自己的文档管理系统。
-
大多数 Win32 API 都可以从 C# 调用,只是需要更多的工作。阅读他链接的文章,然后阅读"P/Invoke"。
-
为什么不在结帐时向结帐目录添加一个文件,其中包含该路径中所有项目的元数据?一个拉SVN。下面是 Olly 回答的最后一个要点:D
标签: c# file properties