The following C# code example lists resources that are
located in /Applications/FormsApplication/1.0/FormsFolder. (See Listing Resources.)
/*
* Ensure that you create a .NET client assembly that uses
* base64 encoding. This is required to populate a BLOB
* object with data or retrieve data from a BLOB object.
*
* For information, see "Invoking LiveCycle using Base64 Encoding"
* in Programming with LiveCycle
*/
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.IO;
namespace RepositoryWebService
{
class ListFiles
{
[STAThread]
static void Main(string[] args)
{
//This quick start lists the content located in Applications/FormsApplication/1.0/FormsFolder
//Ensure that you create a LiveCycle application named Applications/FormsApplication using Workbench
try
{
//Create a RepositoryServiceService object
RepositoryServiceService repositoryClient = new RepositoryServiceService();
repositoryClient.Credentials = new System.Net.NetworkCredential("administrator", "password");
// Specify the folder path
String resourceFolderPath = "/Applications/FormsApplication/1.0/FormsFolder";
// Retrieve the list of resources under the folder path
object[] members = repositoryClient.listMembers(resourceFolderPath, null, null);
// Print out the resources that were found
Console.WriteLine("The following resources were found:");
for (int i = 0; i < members.Length; i++)
{
Resource r = (Resource)(members[i]);
Console.WriteLine(
"Resource name: " +
r.name +
" Resource Description: " +
r.description
);
}
}
catch (Exception e)
{
Console.WriteLine(
"Exception thrown while trying to list the files" +
e.Message
);
}
}
}
}
|
|
|