Home All Groups Group Topic Archive Search About
Author
6 Feb 2007 11:26 AM
Lily
Dear all,

hope everything is fine :)

can anyone tell me how can i connect to the localhost from a windows
application??

i need to refrence the server installed locally from a windows
application, is it possible and how??

i'm using c#, VS 2003 and need to connect to IIS 6.0

any ideas??

Author
6 Feb 2007 11:47 AM
Michael Nemtsev
Hello Lily,

What did u try and where falsed?!
Just make the WebRequres to the http://localhost or http://<yourPCname>

L> hope everything is fine :)
L> can anyone tell me how can i connect to the localhost from a windows
L> application??
L> i need to refrence the server installed locally from a windows
L> application, is it possible and how??
L> i'm using c#, VS 2003 and need to connect to IIS 6.0

---
WBR,  Michael  Nemtsev [C# MVP].  Blog: http://spaces.live.com/laflour
team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Author
6 Feb 2007 12:32 PM
Lily
i'm not lily :(
i think there was something wrong made by google

anyway, can u tell me plz how can i use  WebRequres and do i have
access to it from a windows application


On Feb 6, 1:47 pm, Michael Nemtsev <nemt***@msn.com> wrote:
Show quote
> Hello Lily,
>
> What did u try and where falsed?!
> Just make the WebRequres to thehttp://localhostor http://<yourPCname>
>
> L> hope everything is fine :)
> L> can anyone tell me how can i connect to the localhost from a windows
> L> application??
> L> i need to refrence the server installed locally from a windows
> L> application, is it possible and how??
> L> i'm using c#, VS 2003 and need to connect to IIS 6.0
>
> ---
> WBR,  Michael  Nemtsev [C# MVP].  Blog:http://spaces.live.com/laflour
> team blog:http://devkids.blogspot.com/
>
> "The greatest danger for most of us is not that our aim is too high and we
> miss it, but that it is too low and we reach it" (c) Michelangelo
Author
6 Feb 2007 1:18 PM
Michael Nemtsev
Hello Lily,

what do u wanna do?!
Get data or just browsing?!

For browsing use webbrowse control

for getting data the codesnippet below

public static string GetHTMLFromURL(string url)
{
    if(url.Length == 0)
        throw new ArgumentException("Invalid URL","url");

    string html = "";
    HttpWebRequest request = GenerateGetOrPostRequest(url,"GET",null);
    HttpWebResponse response = (HttpWebResponse)request.GetResponse( );
    try
    {
        if(VerifyResponse(response)== ResponseCategories.Success)
        {
            // get the response stream.
            Stream responseStream = response.GetResponseStream( );
            // use a stream reader that understands UTF8
            StreamReader reader = new StreamReader(responseStream,Encoding.UTF8);

            try
            {
                html = reader.ReadToEnd( );
            }
            finally
            {
                // close the reader
                reader.Close( );
            }
        }
    }
    finally
    {
        response.Close( );
    }
    return html;
}

L> i'm not lily :(
L> i think there was something wrong made by google
L> anyway, can u tell me plz how can i use  WebRequres and do i have
L> access to it from a windows application
L>
L> On Feb 6, 1:47 pm, Michael Nemtsev <nemt***@msn.com> wrote:
L>
Show quote
>> Hello Lily,
>>
>> What did u try and where falsed?!
>> Just make the WebRequres to thehttp://localhostor http://<yourPCname>
>> L> hope everything is fine :)
>> L> can anyone tell me how can i connect to the localhost from a
>> windows
>> L> application??
>> L> i need to refrence the server installed locally from a windows
>> L> application, is it possible and how??
>> L> i'm using c#, VS 2003 and need to connect to IIS 6.0
>> ---
>> WBR,  Michael  Nemtsev [C# MVP].  Blog:http://spaces.live.com/laflour
>> team blog:http://devkids.blogspot.com/
>> "The greatest danger for most of us is not that our aim is too high
>> and we miss it, but that it is too low and we reach it" (c)
>> Michelangelo
>>
---
WBR,  Michael  Nemtsev [C# MVP].  Blog: http://spaces.live.com/laflour
team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Author
6 Feb 2007 3:02 PM
eng.rana
actually i have a virtaul path and i need to convert it to a physical
path from my windows application, so i was wondering how can i
refrence the local server to convert from the virtual path to the
local one?

is there any other ideas to convert a virtual path to a local path
from a windows application???


thanx


On Feb 6, 3:18 pm, Michael Nemtsev <nemt***@msn.com> wrote:
Show quote
> Hello Lily,
>
> what do u wanna do?!
> Get data or just browsing?!
>
> For browsing use webbrowse control
>
> for getting data the codesnippet below
>
> public static string GetHTMLFromURL(string url)
> {
>     if(url.Length == 0)
>         throw new ArgumentException("Invalid URL","url");
>
>     string html = "";
>     HttpWebRequest request = GenerateGetOrPostRequest(url,"GET",null);
>     HttpWebResponse response = (HttpWebResponse)request.GetResponse( );
>     try
>     {
>         if(VerifyResponse(response)== ResponseCategories.Success)
>         {
>             // get the response stream.
>             Stream responseStream = response.GetResponseStream( );
>             // use a stream reader that understands UTF8
>             StreamReader reader = new StreamReader(responseStream,Encoding.UTF8);
>
>             try
>             {
>                 html = reader.ReadToEnd( );
>             }
>             finally
>             {
>                 // close the reader
>                 reader.Close( );
>             }
>         }
>     }
>     finally
>     {
>         response.Close( );
>     }
>     return html;
>
> }
>
> L> i'm not lily :(
> L> i think there was something wrong made by google
> L> anyway, can u tell me plz how can i use  WebRequres and do i have
> L> access to it from a windows application
> L>
> L> On Feb 6, 1:47 pm, Michael Nemtsev <nemt***@msn.com> wrote:
> L>
>
>
>
> >> Hello Lily,
>
> >> What did u try and where falsed?!
> >> Just make the WebRequres to thehttp://localhostorhttp://<yourPCname>
> >> L> hope everything is fine :)
> >> L> can anyone tell me how can i connect to the localhost from a
> >> windows
> >> L> application??
> >> L> i need to refrence the server installed locally from a windows
> >> L> application, is it possible and how??
> >> L> i'm using c#, VS 2003 and need to connect to IIS 6.0
> >> ---
> >> WBR,  Michael  Nemtsev [C# MVP].  Blog:http://spaces.live.com/laflour
> >> team blog:http://devkids.blogspot.com/
> >> "The greatest danger for most of us is not that our aim is too high
> >> and we miss it, but that it is too low and we reach it" (c)
> >> Michelangelo
>
> ---
> WBR,  Michael  Nemtsev [C# MVP].  Blog:http://spaces.live.com/laflour
> team blog:http://devkids.blogspot.com/
>
> "The greatest danger for most of us is not that our aim is too high and we
> miss it, but that it is too low and we reach it" (c) Michelangelo- Hide quoted text -
>
> - Show quoted text -
Author
6 Feb 2007 3:10 PM
Michael Nemtsev
Hello eng.rana,

It's possibe, use HttpRuntime.CodegenDir
the only problem is that your files are not in the virtual folder - they
are compiled into
\v2.0.50727\Temporary ASP.NET Files\<you_app>\bla-bla\bla-bla and it's changes
time to time

so the best way is to use WebRequest with virtual path

e> actually i have a virtaul path and i need to convert it to a physical
e> path from my windows application, so i was wondering how can i
e> refrence the local server to convert from the virtual path to the
e> local one?
e>
e> is there any other ideas to convert a virtual path to a local path
e> from a windows application???

---
WBR,  Michael  Nemtsev [C# MVP].  Blog: http://spaces.live.com/laflour
team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Author
6 Feb 2007 11:48 AM
Mubashir Khan
hey Lily how are u doing girllie ....
i am fine .... :) ... :D

you can use HttpWebRequest and HttpWebResponse for this .....

Show quote
"Lily" <Developer.M***@gmail.com> wrote in message
news:1170761193.557455.120700@a75g2000cwd.googlegroups.com...
> Dear all,
>
> hope everything is fine :)
>
> can anyone tell me how can i connect to the localhost from a windows
> application??
>
> i need to refrence the server installed locally from a windows
> application, is it possible and how??
>
> i'm using c#, VS 2003 and need to connect to IIS 6.0
>
> any ideas??
>

AddThis Social Bookmark Button