예제 #1
0
        static void Main(string[] args)

        {
            _Check_Installation();
            CheckInstall.GetfLocalBridgeDeviceList();



            //           _PrintBridgeCapableList();
            //           CheckInstall._Save_LocalBridge();
            //           CheckInstall._Print_Local_Bridge();
            //          _Local_Bridge_Set();
            //Console.WriteLine("  ");
            //Console.WriteLine("Ready to setup");
            //Console.WriteLine("Enter the index number of Network Card you wish to setup as Local Bridge");
//            Console.ReadKey();
            if (CardTables.flag == 0)
            {
                LocalBridgeChang.localbridgechange();
                new VPNsetupMenu().Run();
                Console.ReadKey();
            }
            else
            {
                new VPNsetupMenu().Run();
                Console.ReadKey();
            }
            // _Enter_choise();
        }
예제 #2
0
        //   private static void Main(string[] args)
        public static void MainControl()
        {
            string machineName = System.Environment.MachineName;

            bool rtdx = CheckInstall.CheckIfInstallDirExists("c:\\Program Files\\VPN_Tools");

            if (rtdx)
            {
                InstallDirExists = "Exists";
            }
            else
            {
                InstallDirExists = "Not Exists";
            }
            string SubDirPath = "c:\\Program Files\\VPN_Tools\\backup.vpn_bridge.config";
            bool   subdirx    = CheckInstall.CheckIfSubDirExists(SubDirPath);

            if (subdirx)
            {
                SubDirPathExists = "Exists";
            }
            else
            {
                SubDirPathExists = "Not Exists";
            }
            string ServiceBridgeExists = "sevpnbridge";
            bool   srvx = CheckInstall.ServiceExists(ServiceBridgeExists);

            if (srvx)
            {
                BridgeService = "Installed";
            }
            else
            {
                BridgeService = "Not Installed";
            }
            string serviceNane = "sevpnbridge";

            Rt = string.Empty;
            // string fg = servicecheckifrunning(serviceNane, Rt);
            string fg = CheckInstall.BridgeServiceCondition(serviceNane, Rt);

            BridgeServiceCondition = fg;
            ServiceController sc = new ServiceController("sevpnbridge");
            string            rf = CheckInstall.StartupType(serviceNane);

            string svstm = CheckInstall.StartupType(serviceNane);

            BridgeServiceStartMode = svstm;
            var svc = new ServiceController("sevpnbridge");

            System.ServiceProcess.ServiceHelper.ChangeStartMode(svc, ServiceStartMode.Manual);

            // var svc1 = new ServiceController("sevpnbridge");
            //if (svc.Status != ServiceControllerStatus.Stopped)
            //{
            //    svc.Stop();
            //}
            svc.Close();
        }
예제 #3
0
        public static string _Bridge_service_condition()
        {
            string serviceNane = "sevpnbridge";

            Rt = string.Empty;
            // string fg = servicecheckifrunning(serviceNane, Rt);
            string fg = CheckInstall.BridgeServiceCondition(serviceNane, Rt);
            //  CheckInstall.BridgeServiceCondition = fg;
            ServiceController sc = new ServiceController("sevpnbridge");
            string            rf = CheckInstall.StartupType(serviceNane);

            Console.WriteLine("Check Bridge Service Startup Mode:" + " " + rf);
            return(rf);
        }
예제 #4
0
        public static void _PrintBridgeCapableList()
        {
            CheckInstall._Capable_cards();
            // var Cap_crds = CheckInstall._Capable_cards();
            var Cap_crds = CardTables._netcards;
            // int w;
            int w1;

            for (int w = 0; w < Cap_crds.Count; w++)

            {
                w1 = w + 1;

                Console.WriteLine(w1.ToString() + ". " + Cap_crds[w].ToString());
            }
        }