本文整理汇总了C#中Com.Aspose.Storage.Api.StorageApi.PutCreate方法的典型用法代码示例。如果您正苦于以下问题:C# StorageApi.PutCreate方法的具体用法?C# StorageApi.PutCreate怎么用?C# StorageApi.PutCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Com.Aspose.Storage.Api.StorageApi
的用法示例。
在下文中一共展示了StorageApi.PutCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(String[] args){
try
{
System.Diagnostics.Debug.WriteLine("\n\nFetching the results...");
StorageApi storageApi = new StorageApi("xxx", "xxx", "http://api.aspose.com/v1.1");
string fileName = "test_multi_pages.docx";
System.Diagnostics.Debug.WriteLine(storageApi.PutCreate(fileName,null, null, System.IO.File.ReadAllBytes("\\temp\\"+fileName)));
//storageApi.PutCreate(fileName, null, null, System.IO.File.ReadAllBytes("\\temp\\resources\\" + fileName));
////System.Diagnostics.Debug.WriteLine(storageApi.GetDownload(fileName, null, null)+"\n\nthese were the file contents");
byte[] responseStream = storageApi.GetDownload(fileName, null, null).ResponseStream;
System.IO.File.WriteAllBytes("\\temp\\new_" + fileName, responseStream);
//System.Diagnostics.Debug.WriteLine(storageApi.GetListFiles("", ""));
//System.IO.File.WriteAllBytes("\\temp\\new_" + fileName, System.IO.File.ReadAllBytes("\\temp\\"+fileName));
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("\nError:"+ex.Message+"\n" + ex.StackTrace + "\n");
}
}
示例2: Main
public static void Main(String[] args)
{
string APIKEY = "xxxxx";
string APPSID = "xxxxx";
string BASEPATH = "http://api.aspose.com/v1.1";
try
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
//string name = "slide_" + new Random().Next(100) + ".pptx";
//string password = null;
//string storage = null;
//string folder = null;
//byte[] file = System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + "test_slide.pptx");
////System.Diagnostics.Debug.WriteLine("-------------working......");
//ResponseMessage actual;
//actual = target.PutNewPresentation(name, password, storage, folder, file);
string name = "test_slide.pptx";
int? slideIndex = 1;
int? shapeIndex = 1;
int? paragraphIndex = 1;
int? portionIndex = 1;
string folder = null;
string storage = null;
Portion body = new Portion();
body.Text = "Newer value";
body.FontColor = "#FFFF0000";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
ResponseMessage actual;
actual = target.PutSetParagraphPortionProperties(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, folder, storage, body);
System.Diagnostics.Debug.WriteLine("-------------working......"+actual);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("--------------------------------\nException:" + ex.Message + "\n" + ex.StackTrace);
}
}
示例3: Run
public static void Run()
{
// ExStart:1
// Instantiate Aspose Storage Cloud API SDK
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// Instantiate Aspose OCR Cloud API SDK
OcrApi ocrApi = new OcrApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// Set the image file name
String name = "Sampleocr.bmp";
// Set the language of the document.
String language = "English";
// Set X and Y coordinate to recognize text inside..
int? rectX = 150;
int? rectY = 100;
//Set Width and Height to recognize text inside.
int? rectWidth = 1000;
int? rectHeight = 300;
//Set the spelling correction is used.
bool? useDefaultDictionaries = true;
//Set 3rd party cloud storage server (if any)
String storage = "";
String folder = "";
try
{
//upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// invoke Aspose.OCR Cloud SDK API to extract text and partsinfo from an image
OCRResponse apiResponse = ocrApi.GetRecognizeDocument(name, language, rectX, rectY, rectWidth, rectHeight, useDefaultDictionaries, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Codetext: " + apiResponse.Text+ "\n");
Console.WriteLine("Extract OCR or HOCR Text from a specific Block, Done!");
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// ExEnd:1
}
开发者ID:farooqsheikhpk,项目名称:Aspose.OCR-for-Cloud,代码行数:52,代码来源:ExtractOCRorHOCRTextFromSpecificBlockImage.cs
示例4: TestDeleteProperties
public void TestDeleteProperties()
{
PdfApi target = new PdfApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "Sample-Annotation.pdf";
string storage = null;
string folder = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\pdf\\resources\\" + name));
Com.Aspose.PDF.Model.SaaSposeResponse actual;
actual = target.DeleteProperties(name, storage, folder);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.PDF.Model.SaaSposeResponse(), actual.GetType());
}
示例5: TestDeleteSlideByIndex
public void TestDeleteSlideByIndex()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
int? slideIndex = 1;
string folder = null;
string storage = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
SlideListResponse actual;
actual = target.DeleteSlideByIndex(name, slideIndex, folder, storage);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.SlideListResponse(), actual.GetType());
}
示例6: TestGetSlidesDocumentProperty
public void TestGetSlidesDocumentProperty()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
string propertyName = "Author";
string folder = null;
string storage = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
DocumentPropertyResponse actual;
actual = target.GetSlidesDocumentProperty(name, propertyName, folder, storage);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentPropertyResponse(), actual.GetType());
}
示例7: TestGetImageRotateFlip
public void TestGetImageRotateFlip()
{
ImagingApi target = new ImagingApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "aspose.jpg";
string format = "png";
string method = "Rotate180FlipX";
string outPath = "";
string folder = "";
string storage = "";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\imaging\\resources\\" + name));
ResponseMessage actual;
actual = target.GetImageRotateFlip(name, format, method, outPath, folder, storage);
Assert.AreEqual(200, actual.Code);
Assert.IsInstanceOfType(new ResponseMessage(), actual.GetType());
}
示例8: Run
public static void Run()
{
// ExStart:1
// Instantiate Aspose Storage Cloud API SDK
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// Instantiate Aspose BarCode Cloud API SDK
BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// set input file name
String name = "sample-barcode.jpeg";
//The barcode type.
//If this parameter is empty, autodetection of all supported types is used.
String type = "";
//Sets mode for checksum validation during recognition
String checksumValidation = "";
//Sets if FNC symbol stripping should be performed.
bool stripFnc = true;
//Sets recognition of rotated barcode
int? rotationAngle = null;
//Sets exact number of barcodes to recognize
int? barcodesCount = null;
//Set recognition of barcode inside specified Rectangle region
int? rectX = 10;
int? rectY = 10;
int? rectWidth = 200;
int? rectHeight = 200;
//Set 3rd party cloud storage server (if any)
String storage = "";
// Set folder location at cloud storage
String folder = "";
try
{
//upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// invoke Aspose.BarCode Cloud SDK API to read barcode with specific region of image
BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder);
if (apiResponse != null)
{
foreach (Barcode barcode in apiResponse.Barcodes)
{
Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType);
}
Console.WriteLine("Read Barcode from Specific Region of Image, Done!");
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// ExEnd:1
}
开发者ID:farooqsheikhpk,项目名称:Aspose.BarCode-for-Cloud,代码行数:67,代码来源:ReadBarcodeFromSpecificRegionOfImage.cs
示例9: TestPostSlidesPresentationReplaceText
public void TestPostSlidesPresentationReplaceText()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
string oldValue = "aspose";
string newValue = "aspose2";
bool? ignoreCase = null;
string folder = null;
string storage = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
PresentationStringReplaceResponse actual;
actual = target.PostSlidesPresentationReplaceText(name, oldValue, newValue, ignoreCase, folder, storage);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.PresentationStringReplaceResponse(), actual.GetType());
}
示例10: TestPostPresentationMerge
public void TestPostPresentationMerge()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
string mergeFile1 = "sample-input.pptx";
string mergeFile2 = "demo.pptx";
string storage = null;
string folder = null;
PresentationsMergeRequest body = new PresentationsMergeRequest();
body.PresentationPaths = new System.Collections.Generic.List<string> {mergeFile1,mergeFile2};
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
storageApi.PutCreate(mergeFile1, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + mergeFile1));
storageApi.PutCreate(mergeFile2, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + mergeFile2));
DocumentResponse actual;
actual = target.PostPresentationMerge(name, storage, folder, body);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.DocumentResponse(), actual.GetType());
}
示例11: TestGetSlidesPresentationTextItems
public void TestGetSlidesPresentationTextItems()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
bool? withEmpty = null;
string folder = null;
string storage = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
TextItemsResponse actual;
actual = target.GetSlidesPresentationTextItems(name, withEmpty, folder, storage);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.TextItemsResponse(), actual.GetType());
}
示例12: Main
//.........这里部分代码省略.........
// ResponseMessage apiResponse = tasksApi.GetTaskDocumentWithFormat(fileName, format, storage, folder);
// if (apiResponse != null)
// {
// //download appended document from storage server
// System.IO.File.WriteAllBytes("\\temp\\" + name + "." + format, apiResponse.ResponseStream);
// Console.WriteLine("Retrieve Outline Codes Information, Done!");
// Console.ReadKey();
// }
//}
//catch (Exception ex)
//{
// System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
//}
/*
* Working with Outline Codes and Extended Attributes
* Retrieve Project Properties
*/
TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
String name = "sample-project.mpp";
String storage = null;
String folder = null;
try
{
//upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));
//invoke Aspose.PDF Cloud SDK API to append word document
DocumentPropertiesResponse apiResponse = tasksApi.GetDocumentProperties(name, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (DocumentProperty docProp in apiResponse.Properties.List)
{
Console.WriteLine(docProp.Name + " :: " + docProp.Value);
}
Console.WriteLine("Retrieve Project Properties, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
///*
//* Working with Outline Codes and Extended Attributes
//* Retrieve Outline Codes Information
//*/
//TasksApi tasksApi = new TasksApi(APIKEY, APPSID, BASEPATH);
//StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
//String name = "sample-project.mpp";
//String storage = null;
示例13: TestGetRecognizeDocument
public void TestGetRecognizeDocument()
{
OcrApi target = new OcrApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "Sampleocr.bmp";
string language = "english";
int? rectX = null;
int? rectY = null;
int? rectWidth = null;
int? rectHeight = null;
bool? useDefaultDictionaries = null;
string storage = null;
string folder = null;
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\ocr\\resources\\" + name));
Com.Aspose.OCR.Model.OCRResponse actual;
actual = target.GetRecognizeDocument(name, language, rectX, rectY, rectWidth, rectHeight, useDefaultDictionaries, storage, folder);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new OCRResponse(), actual.GetType());
}
示例14: TestGetChangeImageScale
public void TestGetChangeImageScale()
{
ImagingApi target = new ImagingApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "aspose_imaging_for_cloud.png";
string format = "jpg";
int? newWidth = 200;
int? newHeight = 200;
string outPath = "";
string folder = "";
string storage = "";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\imaging\\resources\\" + name));
ResponseMessage actual;
actual = target.GetChangeImageScale(name, format, newWidth, newHeight, outPath, folder, storage);
Assert.AreEqual(200, actual.Code);
Assert.IsInstanceOfType(new ResponseMessage(), actual.GetType());
}
示例15: TestPostTiffAppend
public void TestPostTiffAppend()
{
ImagingApi target = new ImagingApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "sample.tif";
string appendFile = "TestDemo.tif";
string storage = "";
string folder = "";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\imaging\\resources\\" + name));
SaaSposeResponse actual;
actual = target.PostTiffAppend(name, appendFile, storage, folder);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new SaaSposeResponse(), actual.GetType());
}