Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@groupdocscloud
Last active April 17, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groupdocscloud/3c211b41ef72c2070064a8ad93f14fdc to your computer and use it in GitHub Desktop.
Save groupdocscloud/3c211b41ef72c2070064a8ad93f14fdc to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new AddOptions
{
FileInfo = fileInfo,
Properties = new List<AddProperty>
{
new AddProperty
{
Value = now,
Type = "DateTime",
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
PossibleName = "timeprinted"
}
},
}
}
};
var request = new AddRequest(options);
var response = apiInstance.Add(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new AddOptions
{
FileInfo = fileInfo,
Properties = new List<AddProperty>
{
new AddProperty
{
Value = now,
Type = "DateTime",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "print"
}
},
}
}
};
var request = new AddRequest(options);
var response = apiInstance.Add(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new AddOptions
{
FileInfo = fileInfo,
Properties = new List<AddProperty>
{
new AddProperty
{
Value = now,
Type = "DateTime",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "Lastprinted",
MatchOptions = new MatchOptions
{
ExactPhrase = true
}
}
},
}
}
};
var request = new AddRequest(options);
var response = apiInstance.Add(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new AddOptions
{
FileInfo = fileInfo,
Properties = new List<AddProperty>
{
new AddProperty
{
Value = now,
Type = "DateTime",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "^.*print.*",
MatchOptions = new MatchOptions
{
IsRegex = true
}
}
},
}
}
};
var request = new AddRequest(options);
var response = apiInstance.Add(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new AddOptions
{
FileInfo = fileInfo,
Properties = new List<AddProperty>
{
new AddProperty
{
SearchCriteria = new SearchCriteriaWithoutValue
{
TagOptions = new TagOptions
{
ExactTag = new Tag
{
Name = "Printed",
Category = "Time"
}
}
},
Value = now,
Type = "DateTime"
}
}
};
var request = new AddRequest(options);
var response = apiInstance.Add(request);
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
using System;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Copy File
class Copy_File
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FileApi(configuration);
try
{
var request = new CopyFileRequest("WordProcessing/one-page.docx", "WordProcessing/one-page-copied.docx", Common.MyStorage, Common.MyStorage);
apiInstance.CopyFile(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing/one-page.docx' file copied as 'WordProcessing/one-page-copied.docx'.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FileApi: " + e.Message);
}
}
}
}
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Copy Folder
class Copy_Folder
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FolderApi(configuration);
try
{
var request = new CopyFolderRequest("WordProcessing", "WordProcessing1", Common.MyStorage, Common.MyStorage);
apiInstance.CopyFolder(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing' folder copied as 'WordProcessing1'.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FolderApi: " + e.Message);
}
}
}
}
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Create Folder
class Create_Folder
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FolderApi(configuration);
try
{
var request = new CreateFolderRequest("", Common.MyStorage);
apiInstance.CreateFolder(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing' folder created.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FolderApi: " + e.Message);
}
}
}
}
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
using System;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Delete File
class Delete_File
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FileApi(configuration);
try
{
var request = new DeleteFileRequest("WordProcessing1/one-page.docx", Common.MyStorage);
apiInstance.DeleteFile(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing1/one-page.docx' deleted.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FileApi: " + e.Message);
}
}
}
}
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Delete Folder
class Delete_Folder
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FolderApi(configuration);
try
{
var request = new DeleteFolderRequest("WordProcessing/WordProcessing1", Common.MyStorage, true);
apiInstance.DeleteFolder(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing/WordProcessing1' folder deleted recusrsively.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FolderApi: " + e.Message);
}
}
}
}
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
using System;
using System.IO;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Download_File
class Download_File
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FileApi(configuration);
try
{
var request = new DownloadFileRequest("WordProcessing/ten-pages.pdf", Common.MyStorage);
Stream response = apiInstance.DownloadFile(request);
using (var fileStream = File.Create("D:\\tenpages.pdf"))
{
response.Seek(0, SeekOrigin.Begin);
response.CopyTo(fileStream);
}
Console.WriteLine("Expected response type is Stream: " + response.Length.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FileApi: " + e.Message);
}
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "Date"
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
PossibleName = "creator"
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "MimeType",
MatchOptions = new MatchOptions
{
ExactPhrase = true
}
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "^dc:.*",
MatchOptions = new MatchOptions
{
IsRegex = true
}
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
ValueOptions = new ValueOptions
{
Value = "Microsoft Office Word",
Type = "String"
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
ExactTag = new Tag
{
Name = "Created",
Category = "Time"
}
}
}
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new ExtractOptions
{
FileInfo = fileInfo
};
var request = new ExtractRequest(options);
var response = apiInstance.Extract(request);
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Get Get Disc Usage
class Get_Disc_Usage
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new StorageApi(configuration);
try
{
var request = new GetDiscUsageRequest(Common.MyStorage);
var response = apiInstance.GetDiscUsage(request);
Console.WriteLine("Expected response type is DiscUsage: " + response.UsedSize.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling StorageApi: " + e.Message);
}
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new InfoApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new InfoOptions()
{
FileInfo = fileInfo
};
var request = new GetInfoRequest(options);
var response = apiInstance.GetInfo(request);
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Get File Versions
class Get_File_Versions
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new StorageApi(configuration);
try
{
var request = new GetFileVersionsRequest("one-page.docx", Common.MyStorage);
var response = apiInstance.GetFileVersions(request);
Console.WriteLine("Expected response type is FileVersions: " + response.Value.Count.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling StorageApi: " + e.Message);
}
}
}
}
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Get Files List
class Get_Files_List
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FolderApi(configuration);
try
{
var request = new GetFilesListRequest("WordProcessing", Common.MyStorage);
var response = apiInstance.GetFilesList(request);
Console.WriteLine("Expected response type is FilesList: " + response.Value.Count.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FolderApi: " + e.Message);
}
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new InfoApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx",
StorageName = Common.MyStorage
};
var options = new TagsOptions
{
FileInfo = fileInfo
};
var request = new TagsRequest(options);
var response = apiInstance.Tags(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new InfoApi(configuration);
var response = apiInstance.GetSupportedFileFormats();
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
using System;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Move File
class Move_File
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FileApi(configuration);
try
{
var request = new MoveFileRequest("WordProcessing/one-page.docx", "WordProcessing1/one-page.docx", Common.MyStorage, Common.MyStorage);
apiInstance.MoveFile(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing/one-page.docx' file moved to 'WordProcessing1/one-page.docx'.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FileApi: " + e.Message);
}
}
}
}
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
using System;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Move Folder
class Move_Folder
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FolderApi(configuration);
try
{
var request = new MoveFolderRequest("WordProcessing1", "WordProcessing\\WordProcessing1", Common.MyStorage, Common.MyStorage);
apiInstance.MoveFolder(request);
Console.WriteLine("Expected response type is Void: 'WordProcessing1' folder moved to 'WordProcessing/WordProcessing1'.");
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FolderApi: " + e.Message);
}
}
}
}
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Is Object Exists
class Object_Exists
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new StorageApi(configuration);
try
{
var request = new ObjectExistsRequest("WordProcessing/one-page.docx", Common.MyStorage);
var response = apiInstance.ObjectExists(request);
Console.WriteLine("Expected response type is ObjectExist: " + response.Exists.Value.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling StorageApi: " + e.Message);
}
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
PossibleName = "creator"
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "Application"
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "NameOfApplication",
MatchOptions = new MatchOptions
{
ExactPhrase = true
}
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "^[N]ame[A-Z].*",
MatchOptions = new MatchOptions
{
IsRegex = true
}
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
ValueOptions = new ValueOptions
{
Value = "Microsoft Office Word",
Type = "String"
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new RemoveOptions
{
FileInfo = fileInfo,
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
ExactTag = new Tag
{
Name = "Created",
Category = "Time"
}
}
}
};
var request = new RemoveRequest(options);
var response = apiInstance.Remove(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = "New Creator",
Type = "String",
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
PossibleName = "creator"
}
},
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var now = DateTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = now,
Type = "DateTime",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "Date"
}
},
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = "microsoft word office",
Type = "String",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "NameOfApplication",
MatchOptions = new MatchOptions
{
ExactPhrase = true
}
}
},
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = "new value",
Type = "String",
SearchCriteria = new SearchCriteria
{
NameOptions = new NameOptions
{
Value = "^NameOfApp.*",
MatchOptions = new MatchOptions
{
IsRegex = true
}
}
},
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = "Microsoft Office Word Application",
Type = "String",
SearchCriteria = new SearchCriteria
{
ValueOptions = new ValueOptions
{
Value = "Microsoft Office Word",
Type = "String"
}
},
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
// For complete examples and data files, please go to https://github.com/groupdocs-metadata-cloud/groupdocs-metadata-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
var configuration = new Configuration(MyAppSid, MyAppKey);
var apiInstance = new MetadataApi(configuration);
var fileInfo = new FileInfo
{
FilePath = "documents/input.docx"
};
var options = new SetOptions
{
FileInfo = fileInfo,
Properties = new List<SetProperty>
{
new SetProperty
{
NewValue = "NewAuthor",
SearchCriteria = new SearchCriteria
{
TagOptions = new TagOptions
{
ExactTag = new Tag
{
Name = "Creator",
Category = "Person"
}
}
},
Type = "String"
}
}
};
var request = new SetRequest(options);
var response = apiInstance.Set(request);
using System;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Is Storage Exist
class Storage_Exist
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new StorageApi(configuration);
try
{
var request = new StorageExistsRequest(Common.MyStorage);
var response = apiInstance.StorageExists(request);
Console.WriteLine("Expected response type is StorageExist: " + response.Exists.Value.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling StorageApi: " + e.Message);
}
}
}
}
using System;
using System.IO;
using GroupDocs.Metadata.Cloud.Sdk.Api;
using GroupDocs.Metadata.Cloud.Sdk.Client;
using GroupDocs.Metadata.Cloud.Sdk.Model.Requests;
namespace GroupDocs.Metadata.Cloud.Examples.CSharp
{
// Upload File
class Upload_File
{
public static void Run()
{
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
var apiInstance = new FileApi(configuration);
try
{
// Open file in IOStream from local/disc.
var fileStream = File.Open("..\\..\\..\\Data\\WordProcessing\\one-page.docx", FileMode.Open);
var request = new UploadFileRequest("WordProcessing/one-page.docx", fileStream, Common.MyStorage);
var response = apiInstance.UploadFile(request);
Console.WriteLine("Expected response type is FilesUploadResult: " + response.Uploaded.Count.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling FileApi: " + e.Message);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment