public static void Run()
        {
            // ExStart:1
            WordsApi   wordsApi   = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            string fileName     = "SampleWordDocument.docx";
            int    sectionIndex = 0;
            string storage      = null;
            string folder       = null;

            try
            {
                // Upload the file
                storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
                // Invoke Aspose.Words Cloud SDK API to get specific section
                SectionResponse apiResponse = wordsApi.GetSection(fileName, sectionIndex, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine(apiResponse.Section.link.Href);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Exemplo n.º 2
0
        public SectionResponse GetSection(long id)
        {
            Section targetSection = _context.Section.Where(s => s.SectionId == id).FirstOrDefault();

            SectionResponse section = new SectionResponse()
            {
                SectionId   = targetSection.SectionId,
                SectionName = targetSection.SectionName,
                VenueName   = targetSection.VenueName
            };

            return(section);
        }