473,797 Members | 3,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting Relative URLs into Absolute URLs

I am using the System.Net.WebC lient() and System.Text.UTF 8Encoding() classes
to get the output from another page of mine. My basic main algorithm is the
following:

utf8.GetString( source.Download Data(finalurl))

However, it keeps telling me

Illegal characters in path.

However, the value of finalurl that I am passing is the following:

/Default.aspx?p1 =1&p2=2&p3=3

This is definitely a valid relative URL, so I am guessing that I just need
to make it an absolute URL. Is there any method that can change a relative
URL into an absolute one for me so that I don't need to do it manually by
concatenating strings? Thanks.

Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Aug 11 '08 #1
1 1811
Look up the URIBuilder class. May help.

"Nathan Sokalski" <ns*******@kyle davidgroup.comw rote in message
news:OI******** ********@TK2MSF TNGP05.phx.gbl. ..
>I am using the System.Net.WebC lient() and System.Text.UTF 8Encoding()
classes to get the output from another page of mine. My basic main
algorithm is the following:

utf8.GetString( source.Download Data(finalurl))

However, it keeps telling me

Illegal characters in path.

However, the value of finalurl that I am passing is the following:

/Default.aspx?p1 =1&p2=2&p3=3

This is definitely a valid relative URL, so I am guessing that I just need
to make it an absolute URL. Is there any method that can change a relative
URL into an absolute one for me so that I don't need to do it manually by
concatenating strings? Thanks.

Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Aug 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9151
by: Joe Cybernet | last post by:
Is there any function for combining an absolute and a relative URL to result in an absolute URL? Like if I have http://www.domain.com and "../images/1.jpeg" it will evaluate to http://www.domain.com/images/1.jpeg. I know WinInet for windows has a function that does this called InternetCombineUrl, I just need the same function in PHP
3
3146
by: Peter Taurins | last post by:
Hi there. I have an included file (header.php) that contanis a reference to a graphic. If I stay at the root level, then I can control the relative path of the image. eg. images/imagename.jpg However, if I include this file (header.php) in a lower level directory then of course, I end up with no image displaying as the relative path is no longer correct.
15
2910
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images: <img src = "/images/Header.gif" What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed...
24
4499
by: sinister | last post by:
After doing a websearch, it appears that it's OK to omit the "http:" to form a relative URL. Are there any pitfalls to this? For example, if there is a page http://www.domain1.com/page1.html with a link to http://www.domain2.com/page2.html you can abbreviate the second link as //www.domain2.com/page2.html
2
1570
by: engwar1 | last post by:
I'm a .NET newbie and am beginning the process of converting an existing personal website to .NET from classic ASP. I'm assuming I want my aspx files in the root of my site in the same place as my asp files. In this way when I eventually get switched over to all aspx files my URLs will not have an extra directory name, only the extensions will change. I've got things set up and working on my dev box but have some questions.
0
1118
by: Flip | last post by:
I am retrieving a web page and then taking an inside table to display as an RSS feed. However, there are some relative URLs in there. Of course they work perfectly fine when using IE and navigating to the page. However when I scrape the html out, and load into a temp file, they longer work due to the relative urls. Is there an easy (ie a method to run over the html table or the request) to transform the relative URLs to absolute ones?...
10
3163
by: tom | last post by:
hi group, i desperately need a function that will transform relative URLs to absolute URLs in the SRC part of <img> tags. ie: function makeAbsolute($html,$basehref) { //if regex match = relative URL ==> return img tag with absolute URL
5
2167
shishisu
by: shishisu | last post by:
I figure this might be a fun challenge to some of you out there... I appreciate all the help. Thanks in advance. Here we go... I have 2 web page (on different servers) I am working on. Here, we'll call them Page-A and Page-B. I want to save some work by only having to maintain 1 web page and the changes made to source page will get reflect onto the other one. In this case, Page-A is the source and Page-B should just have a content...
15
6471
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would make it much easier to slap modualar blocks of markup into page frameworks, which may change and so forth. And the few extra bytes, which even for a fairly large site would not amount to as many bytes as are in a fairly small low-res image, should...
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.