local access

  • Thread starter Thread starter Lily
  • Start date Start date
L

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??
 
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
 
hey Lily how are u doing girllie ....
i am fine .... :) ... :D

you can use HttpWebRequest and HttpWebResponse for this .....
 
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
 
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>
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
 
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


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>


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 -
 
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
 
Back
Top