如何从 infoPath 表单到 Sharepoint 库生成具有唯一 ID 的名称? C#
How to generate a name with unique ID from infoPath form to Sharepoint Library? C#
我用 c# 代码制作了一个提交按钮,该按钮从 infopath 表单提交到 SharePoint 库。在 infopath 表单中,我有一个字段,您必须键入名称。名称必须始终相同 john
我如何在名称后为输入的每个名称生成一个唯一编号 I.E,我添加一个名称如下: john
代码应该生成一个 ID,最后名称将添加为 john 001
、john 002
、john 003
等。
我的信息路径形式:
enter image description here
我的 C# 提交代码:
XPathNavigator root = MainDataSource.CreateNavigator();
// Generate a name for the form to be saved in SharePoint
string formName = Guid.NewGuid().ToString();
// Set the name of the form on the data connection
root.SelectSingleNode(
"//my:formName ", NamespaceManager).SetValue(formName);
// Submit the form to SharePoint
DataConnection spConn =
DataConnections["SharePoint Library Submit"];
spConn.Execute();
e.CancelableArgs.Cancel = false;
我该怎么做
string formName = "Kerkesa" + random();
我在找这个
并且在 random() 函数上有一个 GUID GENERATOR
我用 c# 代码制作了一个提交按钮,该按钮从 infopath 表单提交到 SharePoint 库。在 infopath 表单中,我有一个字段,您必须键入名称。名称必须始终相同 john
我如何在名称后为输入的每个名称生成一个唯一编号 I.E,我添加一个名称如下: john
代码应该生成一个 ID,最后名称将添加为 john 001
、john 002
、john 003
等。
我的信息路径形式:
enter image description here
我的 C# 提交代码:
XPathNavigator root = MainDataSource.CreateNavigator();
// Generate a name for the form to be saved in SharePoint
string formName = Guid.NewGuid().ToString();
// Set the name of the form on the data connection
root.SelectSingleNode(
"//my:formName ", NamespaceManager).SetValue(formName);
// Submit the form to SharePoint
DataConnection spConn =
DataConnections["SharePoint Library Submit"];
spConn.Execute();
e.CancelableArgs.Cancel = false;
我该怎么做
string formName = "Kerkesa" + random(); 我在找这个
并且在 random() 函数上有一个 GUID GENERATOR