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 / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

local access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lily - 06 Feb 2007 11:26 GMT
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??
Michael Nemtsev - 06 Feb 2007 11:47 GMT
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
Lily - 06 Feb 2007 12:32 GMT
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,
>
[quoted text clipped - 14 lines]
> "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
Michael Nemtsev - 06 Feb 2007 13:18 GMT
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,
>>
[quoted text clipped - 13 lines]
>> 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
eng.rana - 06 Feb 2007 15:02 GMT
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,
>
[quoted text clipped - 75 lines]
>
> - Show quoted text -
Michael Nemtsev - 06 Feb 2007 15:10 GMT
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
Mubashir Khan - 06 Feb 2007 11:48 GMT
hey Lily how are u doing girllie ....
i am fine .... :) ... :D

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

> Dear all,
>
[quoted text clipped - 9 lines]
>
> any ideas??

Rate this thread:







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.