FileSubmitConnection.Filename 属性

定义

获取一个 , XPathTypedValue 其计算结果为对象提交表单时当前表单将给出的 FileSubmitConnection 文件名。

public:
 abstract property Microsoft::Office::InfoPath::XPathTypedValue ^ Filename { Microsoft::Office::InfoPath::XPathTypedValue ^ get(); };
public abstract Microsoft.Office.InfoPath.XPathTypedValue Filename { get; }
member this.Filename : Microsoft.Office.InfoPath.XPathTypedValue
Public MustOverride ReadOnly Property Filename As XPathTypedValue

属性值

一个 XPathTypedValue ,其计算结果为提交表单时将给出的文件名。

示例

以下示例使用 FileSubmitConnection 对象的 Filename 属性显示在将表单提交到数据连接时将使用的文件名。

FileSubmitConnection submitConnection = 
   (FileSubmitConnection)(DataConnections["SharePoint Library"]);
MessageBox.Show (submitConnection.Filename.ToString());
Dim submitConnection As FileSubmitConnection = 
   DirectCast(DataConnections["SharePoint Library"], _
   FileSubmitConnection)
MessageBox.Show (submitConnection.Filename.ToString())

注解

FileSubmitConnection 类的 Filename 属性的值作为 对象返回XPathTypedValue,可以通过使用 SetStringValue(String)XPathTypedValue 类的 方法指定文本字符串,或使用 XPathTypedValue 类的 属性指定 XPath 表达式XPath来设置该对象。 有关详细信息和代码示例,请参阅“XPathTypedValue 类”主题。

如果字符串尚未包含“.xml”文件扩展名,则会向字符串追加此文件扩展名。 如果 Filename 属性是一个 null 引用 (Visual Basic) 中 Nothing,则提交表单时将为其提供名称“Form.xml”。

如果在定义数据连接向导的“文件名”框中指定了 XPath 表达式(如 concat (“Status Report -”,field1) ),则可以使用 XPathXPathTypedValue 类的 属性返回该表达式,如以下示例所示。

FileSubmitConnection submitConnection = 
   (FileSubmitConnection)(DataConnections["SharePoint Library"]);
MessageBox.Show (submitConnection.Filename.XPath.ToString());
Dim submitConnection As FileSubmitConnection = 
   DirectCast(DataConnections["SharePoint Library"], _
   FileSubmitConnection)
MessageBox.Show (submitConnection.Filename.XPath.ToString())

此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。

可以通过 Microsoft InfoPath Filler 或 Web 浏览器内打开的表单中运行的代码访问此类型或成员。

适用于