Re: How to get the port number of "Default Web Site" from IIS

Discussion in 'ASP .Net' started by Juan T. Llibre, Dec 7, 2006.

  1. John,

    The port number is quite easy to detect in ASP.NET :

    portnumber.aspx:
    -----------------------
    <script language="vb" runat="server">
    Sub Page_Load()
    Dim baseUri As New Uri("http://localhost/")
    port.Text = "The port number is : " & baseUri.port
    End Sub
    </script>

    <html>
    <head><title>Retrieve Port Number</title></head>
    <body>
    <asp:label id="port" runat="server" /><br/>
    </body>
    </html>
    -------------------------



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "John Paul. A" <> wrote in message
    news:...
    > Hi,
    > I want to get the port number of "Default Web Site" from IIS. Can you please
    > tell me how to get it using the namespace System.DirectoryServices.
    >
    > Thanks,
    > John
    >
     
    Juan T. Llibre, Dec 7, 2006
    #1
    1. Advertising

  2. Hi,
    Thank You.. I can able to get it through your code.

    -John


    "Juan T. Llibre" wrote:

    > John,
    >
    > The port number is quite easy to detect in ASP.NET :
    >
    > portnumber.aspx:
    > -----------------------
    > <script language="vb" runat="server">
    > Sub Page_Load()
    > Dim baseUri As New Uri("http://localhost/")
    > port.Text = "The port number is : " & baseUri.port
    > End Sub
    > </script>
    >
    > <html>
    > <head><title>Retrieve Port Number</title></head>
    > <body>
    > <asp:label id="port" runat="server" /><br/>
    > </body>
    > </html>
    > -------------------------
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "John Paul. A" <> wrote in message
    > news:...
    > > Hi,
    > > I want to get the port number of "Default Web Site" from IIS. Can you please
    > > tell me how to get it using the namespace System.DirectoryServices.
    > >
    > > Thanks,
    > > John
    > >

    >
    >
    >
     
    =?Utf-8?B?Sm9obiBQYXVsLiBB?=, Dec 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mike kim
    Replies:
    2
    Views:
    530
    clintonG
    Aug 20, 2003
  2. mike kim

    IIS default web site

    mike kim, Aug 19, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    559
    John Saunders
    Aug 20, 2003
  3. Mr Newbie

    IIS Default web site

    Mr Newbie, Dec 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,437
    Juan T. Llibre
    Dec 11, 2005
  4. vhrao
    Replies:
    1
    Views:
    616
    Juan T. Llibre
    Jan 5, 2007
  5. John Caruthers
    Replies:
    0
    Views:
    133
    John Caruthers
    Feb 7, 2004
Loading...

Share This Page