rlwakefield / CoMaCon

GNU General Public License v3.0
0 stars 0 forks source link

Add the ability to create a new Web Application from scratch #40

Open rlwakefield opened 1 week ago

rlwakefield commented 1 week ago

Add the ability to create a new Web Application from scratch.

rlwakefield commented 1 week ago

Here is how to create grouped options for the version of the Web Application that is being created.

https://www.w3schools.com/tags/tag_optgroup.asp

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup

rlwakefield commented 1 week ago

Make sure that the option groups can't be selected.

rlwakefield commented 1 week ago

Here is the code to get the folder names of what the different versions that can be created.

using System;
using System.Linq;
using System.IO;

class Program
{
    static void Main()
    {
        string networkFolderPath = @"\\network\path\to\your\folder"; // replace with your network folder path

        // Get all subdirectory names
        string[] ipAddresses = Directory.GetDirectories(networkFolderPath).Select(Path.GetFileName).ToArray();

        // Define your predetermined set of numbers
        string[] predeterminedNumbers = new string[] { "192.168", "10.0" };

        var groupedIPs = ipAddresses
            .GroupBy(ip =>
            {
                foreach (var number in predeterminedNumbers)
                {
                    if (ip.StartsWith(number))
                    {
                        return number;
                    }
                }
                return "Other";
            });

        foreach (var group in groupedIPs)
        {
            Console.WriteLine("Group: " + group.Key);
            foreach (var ip in group)
            {
                Console.WriteLine("\t" + ip);
            }
        }
    }
}