Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using CiscoSwitchTemplate.Utils;
  6.  
  7. namespace CiscoSwitchTemplate
  8. {
  9.     class Configuration
  10.     {
  11.        
  12.  
  13.         struct AgentHostName
  14.         {
  15.             public string AgentName;
  16.             public int PortNumber;
  17.         }
  18.        
  19.         static AgentHostName[] aHostName;
  20.  
  21.         static void Menu()
  22.         {
  23.             Console.WriteLine("\n============================");
  24.             Console.WriteLine("\n[A] Routing ");
  25.            // Console.WriteLine("\n[B] Non-Routing ");
  26.             Console.WriteLine("\nQuit to Stop");
  27.             Console.WriteLine("\n============================\n");
  28.         }
  29.        
  30.         static void Run()
  31.         {
  32.             string Command;
  33.             while (true)
  34.             {
  35.                 Menu();
  36.  
  37.                 Console.Write("\nSelection: ");
  38.                 Command = Console.ReadLine();
  39.  
  40.                 if (Command.Equals("Quit"))
  41.                     break;
  42.                 else if (Command.Equals("A"))
  43.                 {
  44.                     Console.Write("\nRouting");
  45.                     Routing();
  46.                 }
  47.                /* else if (Command.Equals("B"))
  48.                 {
  49.                     Console.Write("\nNon Routing");
  50.                     nRouting();
  51.                 }*/
  52.                 else if (Command.Equals("C"))
  53.                 {
  54.                     PrintTest();
  55.                 }
  56.                 else if (Command.Equals("D"))
  57.                 {
  58.                     VariablesTest();
  59.                 }
  60.                 else if (Command.Equals("E"))
  61.                 {
  62.                     APCTest();
  63.                 }
  64.  
  65.             }
  66.         }
  67.  
  68.         static Array Routing()
  69.         {
  70.             Console.Write("\nHow many Ports will be configured? [1-47]: ");
  71.             int MaxPorts = int.Parse(Console.ReadLine());
  72.             aHostName = new AgentHostName[MaxPorts];
  73.            
  74.             for (int i = 0;  i < MaxPorts; i++)
  75.             {
  76.                 int PortNumber = i + 1;
  77.                 Console.Write("Please enter HostName for Port " + PortNumber + ":");
  78.                 aHostName[i].AgentName = Console.ReadLine();
  79.                 aHostName[i].PortNumber = PortNumber;
  80.             }
  81.             return aHostName;
  82.            
  83.         }
  84.  
  85.         static void PrintTest()
  86.         {
  87.            
  88.             for (int i = 0; i < aHostName.Length; i++)
  89.             Console.Write("\ninterface FastEthernet1/0/" + aHostName[i].PortNumber + "\ndescription " + aHostName[i].AgentName + "\nno shutdown\n");
  90.         }
  91.  
  92.         static void nRouting()
  93.         {
  94.         }
  95.  
  96.         static void APCTest()
  97.         {
  98.             Console.Write("\nHow many APCs will be at this location? ");
  99.             int MaxPorts = int.Parse(Console.ReadLine());
  100.             string[] APC = new string[MaxPorts];
  101.             for (int i = 0; i < MaxPorts; i++)
  102.             {
  103.                 int APCNumber = i + 1;
  104.                 Console.Write("Please enter IP for APC " + APCNumber + ":");
  105.                 APC[i] = Console.ReadLine();
  106.                 Console.Write(APC[i] + "\n");
  107.             }
  108.         }
  109.  
  110.         static void VariablesTest()
  111.         {
  112.             string VTY;
  113.             string Enable;
  114.             string Con;
  115.             string XOMA;
  116.             string XOMB;
  117.             string ILOA;
  118.             string ILOB;
  119.             string LDA;
  120.             string DGC;
  121.             string DNSA;
  122.             string WANIP;
  123.             string WAN_Gateway;
  124.             string WAN_Subnet;
  125.             string Switch_IP;
  126.             string LAN_Gateway;
  127.             string LAN_Subnet;
  128.             string SwitchName;
  129.             string LocationName;
  130.             string AssetID;
  131.            
  132.             Console.Write("Switch HostName: "); SwitchName = Console.ReadLine();
  133.             Console.Write("VTY Password: "); VTY = Console.ReadLine();
  134.             Console.Write("Enable Password: "); Enable = Console.ReadLine();
  135.             Console.Write("Console Password: "); Con = Console.ReadLine();
  136.             Console.Write("XOM 00A Host IP: "); XOMA = Console.ReadLine();
  137.             Console.Write("XOM 00B Host IP: "); XOMB = Console.ReadLine();
  138.             Console.Write("XOM 00A iLO IP: "); ILOA = Console.ReadLine();
  139.             Console.Write("XOM 00A iLO IP: "); ILOB = Console.ReadLine();
  140.             Console.Write("LDA IP: "); LDA = Console.ReadLine();
  141.             Console.Write("DGC IP: "); DGC = Console.ReadLine();
  142.             Console.Write("DNS IP: "); DNSA = Console.ReadLine();
  143.             Console.Write("WAN IP: "); WANIP = Console.ReadLine();
  144.             Console.Write("WAN Gateway IP: "); WAN_Gateway = Console.ReadLine();
  145.             Console.Write("WAN Subnet IP: "); WAN_Subnet = Console.ReadLine();
  146.             Console.Write("LAN Gateway IP: "); LAN_Gateway = Console.ReadLine();
  147.             Console.Write("LAN Subnet IP: "); LAN_Subnet = Console.ReadLine();
  148.             Console.Write("Location Name IP: "); LocationName = Console.ReadLine();
  149.             Console.Write("Asset ID IP: "); AssetID = Console.ReadLine();
  150.  
  151.            
  152.         }
  153.  
  154.        
  155.         static void Main(string[] args)
  156.         {
  157.             Configuration.Run();
  158.         }
  159.     }
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement