473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

URI normalization

Hi,

I'm currently using the System.Uri class for my application. Now, I need the
URL the user enters (and that is parsed to the System.Uri constructor) to be
normalized, so that every unnecessary (or even malicious) stuff is deleted.
Is this possible, and if so, how?

Thanks
Peter
Jul 21 '05 #1
4 2332
Hi Peter,

System.Uri converts URLs into their canonical form in the constructor
automatically and throws a UriFormatException if it can't format it. If you
need to check the URL first you might want to consider regular expressions.

Cheers,
Steve Goodyear
Vancouver, BC
Jul 21 '05 #2
Thanks so far! But when I pass a string/URI that contains e.g. the hex value
'%41' for 'A' the System.Uri class does not decode this one....does it?
At least System.Uri.AbsoluteUri just remains the same....

Greetings
Peter

"Steve Goodyear" wrote:
Hi Peter,

System.Uri converts URLs into their canonical form in the constructor
automatically and throws a UriFormatException if it can't format it. If you
need to check the URL first you might want to consider regular expressions.

Cheers,
Steve Goodyear
Vancouver, BC

Jul 21 '05 #3
You can use System.Web.HttpUtility.UrlDecode()

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message news:1E**********************************@microsof t.com...
Thanks so far! But when I pass a string/URI that contains e.g. the hex value
'%41' for 'A' the System.Uri class does not decode this one....does it?
At least System.Uri.AbsoluteUri just remains the same....

Greetings
Peter

"Steve Goodyear" wrote:
Hi Peter,

System.Uri converts URLs into their canonical form in the constructor
automatically and throws a UriFormatException if it can't format it. If you
need to check the URL first you might want to consider regular expressions.

Cheers,
Steve Goodyear
Vancouver, BC

Jul 21 '05 #4
You can use System.Web.HttpUtility.UrlDecode()

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message news:1E**********************************@microsof t.com...
Thanks so far! But when I pass a string/URI that contains e.g. the hex value
'%41' for 'A' the System.Uri class does not decode this one....does it?
At least System.Uri.AbsoluteUri just remains the same....

Greetings
Peter

"Steve Goodyear" wrote:
Hi Peter,

System.Uri converts URLs into their canonical form in the constructor
automatically and throws a UriFormatException if it can't format it. If you
need to check the URL first you might want to consider regular expressions.

Cheers,
Steve Goodyear
Vancouver, BC

Nov 22 '05 #5

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

Similar topics

3
by: JoeB | last post by:
I found an interesting thread on this from Nov., 2000, but it didn't fully answer my question. I understand normalization, but am trying to find the line between good database design and personal...
2
by: Kostas | last post by:
Hi all, I strived understanding the concepts of all normal forms up to the domain-key normal form but there are some issues I still am unsure of, and I will describe the first one in this post....
7
by: John Welch | last post by:
I have three tables and the way they are currently set up violates good normalization, but I'm having trouble figuring out a better way. Can someone suggest a more elegant solution? My tables...
1
by: Tom | last post by:
Hi: I have a question regarding normalization of a database. I am trying to model the inspection and repair of items. Also need to track when they go in service, out of service and several...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...

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.