C # Method of using System.Uri to URL to absolute address

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.