Beispiel #1
0
        public MainForm()
        {
            InitializeComponent();

            conf = ConnectionConfigDataList.Get();
            lblPath.Text = conf[0].Path;
            camController = new FOSCAMController(conf[0]);
        }
Beispiel #2
0
        public ConfigCameraListForm()
        {
            InitializeComponent();
            list = ConnectionConfigDataList.Get();

            for (int i = 0; i < list.Count; i++ )
            {
                listView1.Items.Add("Câmera " + i.ToString());
            }
        }
        public static void CreateConnectionConfigData()
        {
            if (File.Exists("config.dat"))
            {
                Logger.WriteLine("Loading config file...");
                BinaryFormatter bf = new BinaryFormatter();
                FileStream fs = new FileStream("config.dat", FileMode.Open);
                fs.Seek(0, SeekOrigin.Begin);
                try
                {
                    _configuration = (ConnectionConfigDataList)bf.Deserialize(fs);
                    Logger.WriteLine("Config file loaded !");
                }
                catch (Exception e)
                {
                    Logger.WriteLine("Error loading config file !");
                    Logger.WriteError(e);
                    _configuration = new ConnectionConfigDataList();
                }

                fs.Close();
            }
            else
            {
                Logger.WriteLine("Config file not found !");
                _configuration = new ConnectionConfigDataList();

                ConnectionConfigData a = new ConnectionConfigData();
                a.Address = "10.10.30.5";
                a.UserName = "******";
                a.Password = "******";
                a.Path = "c:\\";

                _configuration.confList.Add(a);

            }
        }