How to find all the port number of our local system using asp.net


How to find all the port number of our local system using asp.net? In this article I'm going to explain how to get list of ports installed in your system by using asp.net. You need to import System.IO.Ports name space top of the page.

In this article I'm going to explain how to get list of ports installed in your system by using asp.net. You need to import System.IO.Ports name space top of the page.



Imports System.IO.Ports
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ports As String() = SerialPort.GetPortNames()
Response.Write("The following serial ports were found in your system:")
Response.Write("<BR>")
' Display each port name to the web page.
Dim strport As String
For Each strport In ports
Response.Write(strport)
Next strport

End Sub
End Class



Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: