Last active
August 31, 2020 08:52
-
-
Save groupdocscloud/646c8583b210bcc2770ea6a518a30be9 to your computer and use it in GitHub Desktop.
This Gist contains .NET examples of GroupDocs.Storage Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage-CSharp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
DeleteFileRequest request = new DeleteFileRequest(); | |
request.Path = "one-page.docx"; | |
var response = apiInstance.DeleteFile(request); | |
Debug.Print("File Deleted: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling DeleteFile: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
DeleteFileRequest request = new DeleteFileRequest(); | |
request.Path = "one-page.docx"; | |
request.Storage = "MyDropBoxStorage"; | |
request.VersionId = null; | |
var response = apiInstance.DeleteFile(request); | |
Debug.Print("File Deleted: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling DeleteFile: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
DeleteFolderRequest request = new DeleteFolderRequest(); | |
request.Path = "mynewfolder"; | |
request.Storage = "MyStorage"; | |
request.Recursive = false; | |
var response = apiInstance.DeleteFolder(request); | |
Debug.Print("Folder Deleted: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling DeleteFolder: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetDiscUsageRequest request = new GetDiscUsageRequest(); | |
request.Storage = "MyStorage"; | |
var response = apiInstance.GetDiscUsage(request); | |
Debug.Print("Result as DiscUsage: " + response.DiscUsage.UsedSize.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetDiscUsage: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetDownloadRequest request = new GetDownloadRequest(); | |
request.Path = "one-page.docx"; | |
request.Storage = "MyStorage"; | |
request.VersionId = null; | |
var response = apiInstance.GetDownload(request); | |
Debug.Print("Result as System.IO.Stream: " + response.Length.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetDownload: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetIsExistRequest request = new GetIsExistRequest(); | |
request.Path = "sample.pdf"; | |
request.Storage = "MyStorage"; | |
request.VersionId = null; | |
var response = apiInstance.GetIsExist(request); | |
Debug.Print("Result as FileExistResponse: " + response.FileExist.IsExist.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetIsExist: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetIsStorageExistRequest request = new GetIsStorageExistRequest(); | |
request.Name= "MyStorage"; | |
var response = apiInstance.GetIsStorageExist(request); | |
Debug.Print("Result as FileExistResponse: " + response.IsExist.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetIsStorageExist: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetListFileVersionsRequest request = new GetListFileVersionsRequest(); | |
request.Path = "sample.pdf"; | |
request.Storage = "MyStorage"; | |
var response = apiInstance.GetListFileVersions(request); | |
Debug.Print("Result as FileVersionsResponse: " + response.FileVersions.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetListFileVersions: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
GetListFilesRequest request = new GetListFilesRequest(); | |
request.Path = "viewerdocs"; | |
request.Storage = "MyStorage"; | |
var response = apiInstance.GetListFiles(request); | |
Debug.Print("Result as FilesResponse: " + response.Files.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling GetListFiles: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PostMoveFileRequest request = new PostMoveFileRequest(); | |
request.Src = "sample.pdf"; | |
request.Storage = "MyStorage"; | |
request.Dest = "sample2.pdf"; | |
request.DestStorage = "MyStorage"; | |
request.VersionId = null; | |
var response = apiInstance.PostMoveFile(request); | |
Debug.Print("File Moved: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PostMoveFile: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PostMoveFolderRequest request = new PostMoveFolderRequest(); | |
request.Src = "mynewfolder"; | |
request.Storage = "MyStorage"; | |
request.Dest = "mynewfolder2"; | |
request.DestStorage = "MyStorage"; | |
var response = apiInstance.PostMoveFolder(request); | |
Debug.Print("Folder Moved: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PostMoveFolder: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCopyRequest request = new PutCopyRequest(); | |
request.Path = "sample.pdf"; | |
request.Storage = "MyStorage"; | |
request.VersionId = null; | |
request.Newdest = "viewerdocs/sample.pdf"; | |
request.DestStorage = "MyStorage"; | |
var response = apiInstance.PutCopy(request); | |
Debug.Print("File Moved: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCopy: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCopyFolderRequest request = new PutCopyFolderRequest(); | |
request.Path = "mynewfolder"; | |
request.storage = "MyStorage"; | |
request.Newdest = "mynewfolder2"; | |
request.DestStorage = "MyStorage"; | |
var response = apiInstance.PutCopyFolder(request); | |
Debug.Print("Folder Copied: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCopyFolder: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCreateRequest request = new PutCreateRequest(); | |
request.Path = "one-page.docx"; | |
request.File = File.Open("D://one-page.docx", FileMode.Open); | |
request.VersionId = null; | |
var response = apiInstance.PutCreate(request); | |
Debug.Print("File Uploaded: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCreate: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCreateRequest request = new PutCreateRequest(); | |
request.Path = "one-page.docx"; | |
request.File = File.Open("D://one-page.docx", FileMode.Open); | |
request.Storage = "MyDropBoxStorage"; | |
request.VersionId = null; | |
var response = apiInstance.PutCreate(request); | |
Debug.Print("File Uploaded: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCreate: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCreateRequest request = new PutCreateRequest(); | |
request.Path = "one-page.docx"; | |
request.File = File.Open("D://one-page.docx", FileMode.Open); | |
request.Storage = "MyDropBoxStorage"; | |
request.VersionId = null; | |
var response = apiInstance.PutCreate(request); | |
Debug.Print("File Uploaded: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCreate: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
StorageApi apiInstance = new StorageApi(configuration); | |
try | |
{ | |
PutCreateFolderRequest request = new PutCreateFolderRequest(); | |
request.Path = "mynewfolder"; | |
request.Storage = "MyStorage"; | |
var response = apiInstance.PutCreateFolder(request); | |
Debug.Print("Folder Created: " + response.Code.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while calling PutCreateFolder: " + e.Message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment