RadioDld.RssServer.RssServer C# (CSharp) Method

RssServer() public method

public RssServer ( int port ) : System
port int
return System
        public RssServer(int port)
        {
            // Initialise and start the http listener
            this.listener = new HttpListener();
            this.listener.Prefixes.Add(string.Format(CultureInfo.InvariantCulture, "http://+:{0}/", port));

            try
            {
                this.listener.Start();
            }
            catch (HttpListenerException exp)
            {
                if (exp.ErrorCode == 5)
                {
                    MessageBox.Show(string.Format(CultureInfo.InvariantCulture, "Unable to start the RSS server, please run the following command as an administrator to resolve the problem:" + Environment.NewLine + Environment.NewLine + "netsh http add urlacl url=http://+:{0}/ user={1}", port, System.Security.Principal.WindowsIdentity.GetCurrent().Name), Application.ProductName);
                }
                else
                {
                    throw;
                }
            }
        }