Re: what is SERVER a member of?




"darrel" <notreal@xxxxxxxxxxx> wrote in message
news:Ow7NFRpoFHA.2156@xxxxxxxxxxxxxxxxxxxxxxx
>> From what I can tell this will not help the OP as the MapPath method is
> not
>> static
>
> I'm not quite sure what you mean by that.

a static method of a class is one which you can invoke independently of
having an instance of that class - it's more like a global function. read up
on OO concepts if you're not clear on this.

>
> Specifically, I'm taking a virtual path:
>
> /documents/shared/ and mapping it to the actual server, be it my local one
> when testing or the live server when deploying.
>

so either of my proposed solutions should work for you

>
>> To reply to the original question. Server is an instance member of the
> Page
>> class
>
> Ah! Well, that explains it.
>
>> 2. Use HttpContext.Current.Server.MapPath(). Through a bit of trickery
>> (well, thread local storage) this can dig out the server object
>> associated
>> with the current request. N.B. If you call this function from a thread
> that
>> is not processing an HTTP request, it will barf at runtime.
>
> This may be a naive question, but aren't all ASP.net threads part of a
> HTTP
> request (ie, postbacks?)

yes (assuming the thread was created by asp.net to handle a request). I was
just making the point that if, for whatever reason, you call that function
from another thread (one you have started yourself or when including this
same utility function in a different application) it won't work

>
> -Darrel
>
>


.



Relevant Pages

  • [NT] 04WebServer Multiple Vulnerabilities (CSS, Log File Injection, AUX DoS)
    ... 04WebServer is a HTTP server developed by Soft3304 for Windows platforms. ... Characters into Log File ... filtering on the request URL before writing it into the log file. ... following HTTP request, when submitted to a vulnerable 04WebServer, will ...
    (Securiteam)
  • RE: Access VSS trough internet
    ... IIS couldn't forward HTTP request to another server. ... Microsoft Online Community Support ...
    (microsoft.public.vstudio.sourcesafe)
  • Re: xml
    ... What you normally do is make an HTTP request to the server and it returns the response. ... It doesn't build or parse XML for you, but compared to writing your own HTTP client to do this, the XML is the "easy" part. ... I have to send a request out over the network thru the router and modem and than receive an answer from a remote server which must be routed to the AS400. ...
    (comp.sys.ibm.as400.misc)
  • Re: xml
    ... HTTP request to the server and it returns the response. ... writing your own HTTP client to do this, the XML is the "easy" part. ...
    (comp.sys.ibm.as400.misc)
  • [REVS] NTLM HTTP Authentication is Insecure By Design
    ... in front of a web server, and that proxy server shares a single TCP ... These are attacks that make use of non-RFC HTTP requests (HTTP Request ... the authentication is associated with the ...
    (Securiteam)