Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

How can I get the name of my script?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
johan - 25 Jul 2007 11:44 GMT
I need to obtain the name of my aspx script from within the
script. I am developing a web counter, and I need to log
the visitors into a file which has the same basename as the
script?
Thanks.
Ray Costanzo - 25 Jul 2007 12:58 GMT
One option is Request.ServerVariables["SCRIPT_NAME"];

Ray at work

>I need to obtain the name of my aspx script from within the
> script. I am developing a web counter, and I need to log
> the visitors into a file which has the same basename as the
> script?
> Thanks.
johan - 25 Jul 2007 13:11 GMT
> One option is Request.ServerVariables["SCRIPT_NAME"];

Hello,
Do you know how to get the ip address in text format i.e

www.helloworld.com rather than 10.10.10.10

I know about those
sw.WriteLine(Request.ServerVariables("REMOTE_ADDR"))
sw.WriteLine(Request.ServerVariables("HTTP_REFERER"))
sw.WriteLine(Request.ServerVariables("HTTP_X_FORWARDED_FOR"))
sw.WriteLine(Request.ServerVariables("REMOTE_HOST"))

but all I get is ip address in the "number" format
Patrice - 25 Jul 2007 13:16 GMT
See System.Net.Dns to resolve the address (it can be done at the IIS level
but with some additional cost for *each* request).

As the example looks like a web site if you want the name of the site your
code is running this is Request.ServerVariables("SERVER_NAME") (likely
exposed in a friendly way by ASP.NET by a property such as
Request.Server.Name or something similar)

--
Patrice

>> One option is Request.ServerVariables["SCRIPT_NAME"];
>
[quoted text clipped - 10 lines]
>
> but all I get is ip address in the "number" format

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.