本文整理汇总了C#中Com.Aspose.Storage.Api.StorageApi类的典型用法代码示例。如果您正苦于以下问题:C# StorageApi类的具体用法?C# StorageApi怎么用?C# StorageApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StorageApi类属于Com.Aspose.Storage.Api命名空间,在下文中一共展示了StorageApi类的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: 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 = "";
// Set folder location at cloud storage
String folder = "";
BarcodeReader body = new BarcodeReader();
// Set if FNC symbol stripping should be performed.
body.StripFNC = true;
// Set mode for checksum validation during recognition
body.ChecksumValidation = "ON";
// Set special mode of barcode binarization
body.BinarizationHints = BinarizationHints.ComplexBackground;
try
{
//upload source file to aspose cloud storage
BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body);
// invoke Aspose.BarCode Cloud SDK API to recognition of a barcode from file on server with parameters in body
apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body);
if (apiResponse != null)
{
foreach (Barcode barcode in apiResponse.Barcodes)
{
Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType);
}
Console.WriteLine("Recognize Barcode with Checksum Option, Done!");
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// ExEnd:1
}
示例3: 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);
}
}
示例4: 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
示例5: 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());
}
示例6: TestDeleteCalendarException
public void TestDeleteCalendarException()
{
TasksApi target = new TasksApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "sample-project.mpp";
int? calendarUid = 1;
int? index = 1;
string fileName = null;
string storage = null;
string folder = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + name));
SaaSposeResponse actual;
actual = target.DeleteCalendarException(name, calendarUid, index, fileName, storage, folder);
Assert.AreEqual("200", actual.Code);
Assert.IsInstanceOfType(new SaaSposeResponse(), actual.GetType());
}
示例7: 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());
}
示例8: 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());
}
示例9: 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());
}
示例10: TestPostAddNewShape
public void TestPostAddNewShape()
{
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;
Shape body = new Shape();
body.Name = "Aspsoe";
body.ShapeType = "Line";
body.AlternativeText = "aspose.com";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
ResponseMessage actual;
actual = target.PostAddNewShape(name, slideIndex, folder, storage, body);
Assert.AreEqual(200, actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType());
}
示例11: 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());
}
示例12: TestGetSlidesSlideShapesParent
public void TestGetSlidesSlideShapesParent()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
int? slideIndex = 1;
string shapePath = "1";
string folder = null;
string storage = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
ResponseMessage actual;
actual = target.GetSlidesSlideShapesParent(name, slideIndex, shapePath, folder, storage);
Assert.AreEqual(200, actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType());
}
示例13: TestPostSlidesSaveAsTiff
public void TestPostSlidesSaveAsTiff()
{
SlidesApi target = new SlidesApi(APIKEY, APPSID, BASEPATH);
StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH);
string name = "test_slide.pptx";
string password = null;
string storage = null;
string folder = null;
string outPath = null;
TiffExportOptions body = new TiffExportOptions();
body.ExportFormat = "tiff";
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\slides\\resources\\" + name));
ResponseMessage actual;
actual = target.PostSlidesSaveAsTiff(name, password, storage, folder, outPath, body);
Assert.AreEqual(200, actual.Code);
Assert.IsInstanceOfType(new Com.Aspose.Slides.Model.ResponseMessage(), actual.GetType());
}
示例14: Main
//.........这里部分代码省略.........
//String storage = "";
//String folder = "";
//try
//{
// //upload source file to aspose cloud storage
// storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes("\\temp\\tasks\\resources\\" + fileName));
// //invoke Aspose.PDF Cloud SDK API to append word document
// 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);
}
///*
示例15: 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());
}