Ejemplo n.º 1
0
        public async Task<bool> RequestFirewallRule()
        {
            var fwManager = new FirewallHelper();
            string title = "";
            Assembly currentAssem = typeof(ServiceRunner).Assembly;
            object[] attribs = currentAssem.GetCustomAttributes(typeof(AssemblyTitleAttribute), true);
            if (attribs.Length > 0)
            {
                title = ((AssemblyTitleAttribute)attribs[0]).Title;
            }


            var path = Assembly.GetExecutingAssembly().Location;
            return await fwManager.openFirewall(title, path, _portNumber);
        }