473,385 Members | 1,564 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,385 software developers and data experts.

Is there a way to detect a complete URL?

Hi,
We have a web form where the user should enter a complete URL including the
protocol, so "www.myURL.com" is not considered valid, it should be
"http://www.myURL.com" or "mms://www.myURL.com" or something like that...

Is there a way I can detect if an URL is complete?
"mailto:my****@mydomain.com" should be supported... so I can't look if it
contains "://" Is there a regex I can use? Is there a class for this
fonctionality included in the .NET framework?

Thanks

ThunderMusic
Nov 22 '07 #1
2 995
Hi,

yes, there is a class for this: System.Uri

Simply use

System.Uri uriTemp = new System.Uri(URL_TO_BE_VALIDATED);

Regards,

Paulo Santos
http://pjondevelopment.50webs.com

On Nov 22, 12:27 pm, "ThunderMusic"
<NoSpAmdanlatathotmaildot...@NoSpAm.comwrote:
Hi,
We have a web form where the user should enter a complete URL including the
protocol, so "www.myURL.com" is not considered valid, it should be
"http://www.myURL.com" or "mms://www.myURL.com" or something like that...

Is there a way I can detect if an URL is complete?
"mailto:myn...@mydomain.com" should be supported... so I can't look if it
contains "://" Is there a regex I can use? Is there a class for this
fonctionality included in the .NET framework?

Thanks

ThunderMusic
Nov 22 '07 #2
ThunderMusic wrote:
Hi,
We have a web form where the user should enter a complete URL including the
protocol, so "www.myURL.com" is not considered valid, it should be
"http://www.myURL.com" or "mms://www.myURL.com" or something like that...

Is there a way I can detect if an URL is complete?
"mailto:my****@mydomain.com" should be supported... so I can't look if it
contains "://" Is there a regex I can use? Is there a class for this
fonctionality included in the .NET framework?

Thanks

ThunderMusic

In webpage or web control, you can use property Request.Url to get
current request url

--
Duy Lam Phuong
Nov 23 '07 #3

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

Similar topics

4
by: Doug R | last post by:
Hello, I could use a little help from you Gurus out there. I have an aplication that watches a directory and detects when a PGP encrypted file lands in the directory and starts a process that...
2
by: Yurij Nykon | last post by:
Hi all. How can I detect the version of Flash-Plugin installed in Internet Explorer? In Netscape i can do this with following java script navigator.plugins.description But it doesn't works...
8
by: Hayato Iriumi | last post by:
Hello, I'm trying to find a way to detect whether CD-ROM was inserted into the CD-ROM drive using C#. Does anyone have any idea how to do this? WMI? Win32 API? TIA
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
2
by: yxq | last post by:
Hello How to detect that own program has been executed? Prevent to execute twice! Thanks
2
by: eBob.com | last post by:
I've got the basics of an XML ini file working. I.E. I can stash away and retrieve user preferences. (Code below.) But how do I handle a new preference? Say I have A and B. And then I invent...
3
by: ladal | last post by:
Hi I just want to know how do I detect an usb drive when it's plug and retrieve his name, in vb.net Thanx
3
by: Asterbing | last post by:
Since the "on fly addition..." thread has taken another direction, I'm opening a new one to be more explicit and recenter the subject. Well, the subject is to detect when a document is well...
2
by: barthelemy.von.haller | last post by:
Hi all, I googled and read this group but could not find any solution to my problem. I have a page to download big excel files that we 'build' on the server side. When a user click on the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...

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.