Gets the storage object.
// You need to assign your bucket in your code string bucket = "TestBucket"; // You need to assign your object name (file name) in your code string objectName = "test.txt"; // You need to assign your app key and your secret key in your code var client = new BaiduBCSClient("your app key", "your secret key"); // Firstly, we need to create a file for upload test later. //Supposed that the test machine has disk D and application has enough permission to operate on that. File.WriteAllText(@"D:\" + objectName, "Test string \n\r Hello world."); // Read/Load the bytes for creating object. byte[] content = File.ReadAllBytes(@"D:\" + objectName); // Upload bytes and file information var md5 = client.CreateStorageObject(new StorageObjectUploadRequest { Bytes = content, BucketName = bucket, ObjectName = objectName, DownloadFileName = "DownloadName.dat", ContentType = "text/plain", IsSuperFile = false, Permission = StorageObjectPermission.PublicReadAndWrite }); // We try to get meta data for the uploaded file. var meta = client.GetStorageObjectMetaInfo(new StorageObjectDownloadRequest { BucketName = bucket, ObjectName = objectName }); // We try to get whole byte data for the uploaded file. var data = client.GetStorageObject(new StorageObjectDownloadRequest { BucketName = bucket, ObjectName = objectName }); // We also can save file in local by specific path client.SaveStorageObjectAs(new StorageObjectDownloadRequest { BucketName = bucket, ObjectName = objectName }, @"D:\DownloadedTest.txt"); // Test file needs to be deleted. client.DeleteStorageObject(new StorageObjectIdentity { BucketName = bucket, ObjectName = objectName });