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 hyperlinkIndex = 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 particular hyperlink HyperlinkResponse apiResponse = wordsApi.GetDocumentHyperlinkByIndex(fileName, hyperlinkIndex, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Com.Aspose.Words.Model.Hyperlink hyperlink = apiResponse.Hyperlink; Console.WriteLine("Display Text: " + hyperlink.DisplayText + " Value: " + hyperlink.Value + " link: " + hyperlink.link.Href); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet2"; int hyperlinkIndex = 0; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to get hyperlinks from worksheet HyperlinkResponse apiResponse = cellsApi.GetWorkSheetHyperlink(fileName, sheetName, hyperlinkIndex, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Hyperlink Address : " + apiResponse.Hyperlink.Address); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }