【问题标题】:Lotus Notes & C#: Passing a Date value to a fieldLotus Notes 和 C#:将日期值传递给字段
【发布时间】:2016-02-22 12:47:50
【问题描述】:

我正在尝试编写一个将日期值(Date in Notes)存储在 Document 中的应用程序。

如何将我的C# 应用程序中的“日期”值传递给LotusNotes

【问题讨论】:

  • 到目前为止您尝试了哪些方法?
  • 通过doc.replaceitemvalue("TheDateField", DateTime.Now.ToString)传递字符串

标签: c# lotus-notes lotus-domino lotusscript


【解决方案1】:

创建一个NotesDateTime 对象,将值设置为现在并分配给您的字段:

NotesDateTime dateTime = session.createDateTime("");
dateTime.SetNow();
doc.replaceItemValue("TheDateField", dateTime);

【讨论】:

  • 我不知道您使用的是哪些参考,但在 Domino 和 Lotus refrence 中,我无法将空字符串传递给 NotesDateTime。编译器 thors 此消息:"NotesDateTime" enthält keinen Konstruktor, der 1 Argumente animmt. 英文:"NotesDateTime" 没有采用 1 个参数的构造函数。
  • 如果您将 0 个参数传递给构造函数,则会引发“COMException”。这让我有点困惑..:D
  • 它是否适用于session.createDateTime("");session 属于 NotesSession 类。
  • NotesDateTime dateTime = session.CreateDateTime(""); dateTime.SetNow(); 编译没有错误。似乎有效,非常感谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多