قم بتغيير نوع هدف الارتباط HTML
Contents
[
Hide
]
Aspose.Cells يسمح لك بتغيير نوع هدف الارتباط HTML. الارتباط HTML يشبه هذا
<a href="http://www.aspose.com/" target="_self">
كما ترى السمة الهدف في الرابط أعلاه HTML هي ** _ self . يمكنك التحكم في هذه السمة الهدف باستخدام خاصية [ HtmlSaveOptions.LinkTargetType ] (https://reference.aspose.com/cells/net/aspose.cells/htmlsaveoptions/properties/linktargettype). تأخذ هذه الخاصية [ HtmlLinkTargetType **] (https://reference.aspose.com/cells/net/aspose.cells/htmllinktargettype) التعداد الذي يحتوي على القيم التالية.
- HtmlLinkTargetType.Blank
- HtmlLinkTargetType.Parent
- HtmlLinkTargetType.Self
- HtmlLinkTargetType. أعلى
يوضح الكود التالي استخدامHtmlSaveOptions.LinkTargetType خاصية. يقوم بتغيير نوع الارتباط الهدف إلىفارغ. بشكل افتراضي ، يكون ملفالأبوين.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
string inputPath = dataDir + "Sample1.xlsx"; | |
string outputPath = dataDir + "Output.out.html"; | |
Workbook workbook = new Workbook(dataDir + "Sample1.xlsx"); | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.LinkTargetType = HtmlLinkTargetType.Self; | |
workbook.Save(outputPath, opts); | |
Console.WriteLine("File saved: {0}", outputPath); |