Visual Studio .NET - find targeted file

Asked By Zeljko Mrcic
29-Aug-10 05:34 PM
if I have uri like http://somedomain.com/september/

and its giving me a response, like normal request, like http://somedomain.com/september/septemberdata.hml
how can I find which file is at the end of the uri?
  Ken Fitzpatrick replied to Zeljko Mrcic
29-Aug-10 08:34 PM

Not sure I understand, but if you have a the URL in a string, you can use the split function to get the filename out of it.
The following example VB code will strip it out into a variable called filename:

Dim url As String = "http://somedomain.com/september/septemberdata.hml"
  
'Split the url up by the slash into an array
Dim url_parts() As String = url.Split("/"c)
  
'The filename is the element numbered one less then the array length
Dim filename As String = url_parts(url_parts.Length - 1)

If there are any querystring parameters after the filename, you can remove them with the following code:
Dim filename_parts() As String = filename.Split("?"c)
filename = filename_parts(0)

Hope this helps,

Ken
  Super Man replied to Zeljko Mrcic
30-Aug-10 01:00 AM

when you request this http://somedomain.com/september/

if directory listing in enable for normal user then you can see the content of that directory.

but when you use http://somedomain.com/september server uses some mechanism and redirect to 

http://somedomain.com/september/septemberdata.hml

you might see that when you use some site

www.example.com

then it will open www.example.com/defualt.aspx

  Zeljko Mrcic replied to Ken Fitzpatrick
30-Aug-10 02:35 AM
No this does not help...you are right...thats the way to read querystring...but...
I have url http://somedomain.com/september/septemberdata.hml and when I run this in browser it gives me some data...but what FILE is at the end of the url, what is the target of that address? Is it sep.html, sep.aspx....or something else?
  Goniey N replied to Zeljko Mrcic
30-Aug-10 06:02 AM
Hi, Zeljko Mrcic,

Your Question Is Very Odd. Because It's Not Possible That After "http://somedomain.com/september/" This URL What Will Be There There May Be Many Filenames After This Directory.


//Here Your Given Path Is Nothing But The Directory Path & if That Site Allow You To Access That Directory Then & Then Only You Can Access Otherwise it Will Give You Error..


//But one Way Is That You Can Open The home Page..

In The Address bar Write "http://somedomain.com/september/*.*" & Then Press EnterThen It Will Redirect You To Home Page Directly.....

& In The Address bar It Will Display "http://www.somedomain.com/?dl=1" This URL...


//Hope This Will Helps You....
  Zeljko Mrcic replied to Goniey N
31-Aug-10 06:00 AM
*.* at the end sends me to error page...
It seams that I'm not well understood...
if I type "http://somedomain.com/september/" in explorer address, I get, let say page(I don't know extension) saying "Money transfer in September 2010 was 4 USD"
I tough that it was some kind of AJAX, but no xmlhttp requests on page I get(via "view source"), like there is some kind of parser on web server, gathering 'september'  from request, and then generating data from database and sending it back...but there are all kind of pages...they MUST have something like ?PeriodID=1&Year=&....at the end of request....but I can't see that anywhere...even FireBug...
Create New Account
help
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not