The example in this article describes C # 's method of using System.Uri to URL to an absolute address. Share to everyone for your reference. The specific analysis is as follows:
When you use Aspose.word to generate a Word document, you can write text messages to the Word document (embedded in the image) by inserthtml (HTML), but require that the image in the HTML src be an absolute full path, so you need to convert the HTML.
Get HTML can come from database data or crawl through the network, and then use System.Uri to replace.
Examples are as follows:
Uri uri = new Uri (http://www.baidu.com); Uri uri2 = new Uri (URI, "abc/123.html"); Console.WriteLine (Uri2. ToString ());//Output http://www.baidu.com/abc/123.html
I hope this article is helpful to everyone's C # programming.
In addition to the Declaration,
Running GuestArticles are original, reproduced please link to the form of the address of this article
C # Method of using System.Uri to URL to absolute address
This address: http://www.paobuke.com/develop/c-develop/pbk23139.html
Related content C # development Portal and Applications (3) text message and message reply sql+c# implementation get the first day of the current month with the last day control of the delay and immediate execution of the Enumerable class method in LINQ C # will private information (bank account, ID number) Middle part special character replaced by *
C # How to synchronize network time example of C # implementation matrix multiplication Instance Analysis C # Methods of using the DirectoryInfo class to obtain directory information and properties C # implements methods for capturing external variables in anonymous methods
C # Method of using System.Uri to URL to absolute address