Search Method
This method searches for resources matching the specified query.
Syntax
[VB.NET] Public Sub Search(ByVal query As String)
[C#] public void Search(string query);
Remarks
This method may be called to search for resources matching the query parameter. The query value will automatically be URL encoded.
After calling this method set ResourceIndex to a value from 0 to ResourceCount - 1. Setting ResourceIndex populates other Resource properties to provide information about the resource. After calling this method the following resource properties are populated:
- ResourceCount
- ResourceCRC32Hash
- ResourceCreatedDate
- ResourceData
- ResourceDeleted
- ResourceDescription
- ResourceDownloadURL
- ResourceETag
- ResourceId
- ResourceIndex
- ResourceMarker
- ResourceMIMEType
- ResourceModifiedDate
- ResourceName
- ResourceParentId
- ResourceParentPath
- ResourcePath
- ResourceSHA1Hash
- ResourceSize
- ResourceType
- ResourceWebURL
If the results are paged ResourceMarker will be populated. Call Search again to retrieve the next page of results. Continue calling Search until ResourceMarker is empty string to retrieve all pages.
Example:
onedrive.Search("vacation photos"); for (int i = 0; i < onedrive.ResourceCount; i++) { onedrive.ResourceIndex = i; Console.WriteLine(onedrive.ResourceName); Console.WriteLine(onedrive.ResourceSize); Console.WriteLine(onedrive.ResourceModifiedDate); }NOTE: This method has a corresponding asynchronous version (SearchAsync) for use in the Xamarin environment.