Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How can I get the name of my script?

Reply
Thread Tools

How can I get the name of my script?

 
 
Guest
Posts: n/a
 
      07-25-2007
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.


 
Reply With Quote
 
 
 
 
Ray Costanzo
Guest
Posts: n/a
 
      07-25-2007
One option is Request.ServerVariables["SCRIPT_NAME"];

Ray at work

<johan> wrote in message news:%(E-Mail Removed)...
>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.
>
>

 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      07-25-2007
> 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_FORWA RDED_FOR"))
sw.WriteLine(Request.ServerVariables("REMOTE_HOST" ))

but all I get is ip address in the "number" format


 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      07-25-2007
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

<johan> a écrit dans le message de news:
http://www.velocityreviews.com/forums/(E-Mail Removed)...
>> 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_FORWA RDED_FOR"))
> sw.WriteLine(Request.ServerVariables("REMOTE_HOST" ))
>
> but all I get is ip address in the "number" format
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
adding a variable name to a hash to name is part of the variable name Bobby Chamness Perl 2 04-22-2007 09:54 PM
how can i retrieve the name of form when one of the element name in this form is 'name' ashok.dhananjeyan@gmail.com Javascript 6 11-24-2006 02:54 AM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments