HttpRuntimeSection.RequireRootedSaveAsPath 属性

定义

获取或设置一个值,该值指示文件名是否必须为完全限定的物理文件路径。Gets or sets a value that indicates whether the file name must be a fully qualified physical file path.

public:
 property bool RequireRootedSaveAsPath { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("requireRootedSaveAsPath", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public bool RequireRootedSaveAsPath { get; set; }
[<System.Configuration.ConfigurationProperty("requireRootedSaveAsPath", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.RequireRootedSaveAsPath : bool with get, set
Public Property RequireRootedSaveAsPath As Boolean

属性值

Boolean

如果文件名必须为完全限定的物理文件路径,则为 true;否则为 falsetrue if the file name must be a fully qualified physical file path; otherwise, false. 默认值是 trueThe default value is true.

属性

示例

下面的示例演示如何使用 RequireRootedSaveAsPath 属性。The following example shows how to use the RequireRootedSaveAsPath property.

// Get the RequireRootedSaveAsPath property value.
Response.Write("RequireRootedSaveAsPath: " +
  configSection.RequireRootedSaveAsPath + "<br>");

// Set the RequireRootedSaveAsPath property value to true.
configSection.RequireRootedSaveAsPath = true;
' Get the RequireRootedSaveAsPath property value.
Response.Write("RequireRootedSaveAsPath: " & _
  configSection.RequireRootedSaveAsPath & "<br>")

' Set the RequireRootedSaveAsPath property value to true.
configSection.RequireRootedSaveAsPath = True

注解

RequireRootedSaveAsPath属性指定方法的文件名参数是否 SaveAs 必须是根路径。The RequireRootedSaveAsPath property specifies whether the file name argument to SaveAs methods must be a rooted path. ASP.NET 进程必须有权在指定位置创建文件。The ASP.NET process must have permission to create files in the specified location.

有关详细信息,请参阅类中定义的保存方法 ConfigurationFor more information, see the save methods defined in the Configuration class.

适用于