473,394 Members | 1,663 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 2331
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.