Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: How to get the port number of "Default Web Site" from IIS

Reply
Thread Tools

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

 
 
Juan T. Llibre
Guest
Posts: n/a
 
      12-07-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9obiBQYXVsLiBB?=
Guest
Posts: n/a
 
      12-08-2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
vs.net 2003 cannot open asp.net project when IIS port number is changed vhrao ASP .Net 1 01-05-2007 05:54 PM
OT: Number Nine, Number Nine, Number Nine Frisbee« MCSE 37 09-26-2005 04:06 PM
How to get the path of remotly run application by knowing the port number sundy.jk@gmail.com Java 3 04-05-2005 05:40 AM
about "match ip rtp starting-port-number port-range" Weiguang Shi Cisco 1 10-25-2003 07:14 AM



Advertisments