SPWeb.GetFileAsString method

Gets the contents of the file object located at the specified URL as a string.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public string GetFileAsString(
	string url
)

Parameters

url
Type: System.String

The URL for the file.

Return value

Type: System.String
The contents of the file.

ExceptionCondition
ArgumentNullException

url is null .

Use this method to get a string that contains the contents of the file object located at the specified URL.

Show: