473,493 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parse File Name From Web Address

Using VB.Net what is the best way to parse a file name from a web address?

For example:
http://www.website.com/downloads/video1.avi

I want to extract video1.avi from the above address.

Thanks In Advance,
Lou
Nov 21 '05 #1
2 4154
Lou,
I normally use System.File.IO.Path, something like:

Dim path As String = "http://www.website.com/downloads/video1.avi"
Dim fileName As String = System.IO.Path.GetFileName(path)

Hope this helps
Jay

"Lou Civitella" <lo*@webersystems.com> wrote in message
news:eC**************@TK2MSFTNGP14.phx.gbl...
| Using VB.Net what is the best way to parse a file name from a web address?
|
| For example:
| http://www.website.com/downloads/video1.avi
|
| I want to extract video1.avi from the above address.
|
| Thanks In Advance,
| Lou
|
|
Nov 21 '05 #2
You could use a regex:
Public Dim MyRegex as Regex = New Regex( _
"[^/]+$", _
RegexOptions.RightToLeft _
)

"Lou Civitella" <lo*@webersystems.com> wrote in message
news:eC**************@TK2MSFTNGP14.phx.gbl...
Using VB.Net what is the best way to parse a file name from a web address?

For example:
http://www.website.com/downloads/video1.avi

I want to extract video1.avi from the above address.

Thanks In Advance,
Lou

Nov 21 '05 #3

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

Similar topics

9
4531
by: Martoni | last post by:
I need to parse a string with an embedded email address. The string always has the format NAME (name@domain) SOMETEXT. What I need to get is the email address as name@domain. I came up with this...
2
2871
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
6
9694
by: Dave Kuhlman | last post by:
Suppose that I have content that looks like what I've included at the end of this message. Is there something in the standard Python library that will help me parse it, break into the parts...
21
2629
by: William Stacey [MVP] | last post by:
Anyone know of some library that will parse files like following: options { directory "/etc"; allow-query { any; }; // This is the default recursion no; listen-on { 192.168.0.225;...
5
9085
by: Michael C# | last post by:
Hi all, I'm about to start writing a routine to parse "standard" U.S. Addresses (if there is such a thing...) Before I jump off into this, I was just wondering if maybe someone out there had...
1
1656
by: jgn1013 | last post by:
This is what i'm currently doing, but what I would like is parse the xml only get phone, cellphone, name & userid. I'm getting a http stream xml file: sample below <root> <bhcontact name="john...
11
2334
by: Peter Afonin | last post by:
Hello, I need to parse a string that returns the domain DNS records and to put this data into a DataTable. I don't have much experience in parsing strings, so I'm not aware of the efficient way...
2
1322
by: anilkunar | last post by:
Suppose I have a xml file named person.xml i.e. <person> <name> <firstname> Anil </firstname> <lastname> Nayak </lastname>
3
5036
by: broll911 | last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me. here is the error. Parse error: syntax error,...
0
7119
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
6989
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
7195
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...
1
6873
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...
1
4889
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...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
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...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
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...

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.