コード例 #1
0
        private void ReadConfiguration()
        {
            var settings = new Properties.Settings();

            this.Db4oFileName = System.Environment.ExpandEnvironmentVariables(settings.DatabaseFileName);

            //Windows services are executed from the Windows folder ususally.
            //So if our database should be anywhere else, we need to rebase our db file path.
            if (!System.IO.Path.IsPathRooted(this.Db4oFileName))
            {
                //todo: System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
                this.Db4oFileName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), this.Db4oFileName);
            }

            this.ListenPort = settings.ListenPort;

            this.ClientUsername = settings.Username;

            this.ClientPassword = settings.Password;
        }
コード例 #2
0
        private void ReadConfiguration()
        {
            var settings = new Properties.Settings();

            this.Db4oFileName = System.Environment.ExpandEnvironmentVariables(settings.DatabaseFileName);

            //Windows services are executed from the Windows folder ususally.
            //So if our database should be anywhere else, we need to rebase our db file path.
            if(!System.IO.Path.IsPathRooted(this.Db4oFileName))
                //todo: System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
                this.Db4oFileName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), this.Db4oFileName);

            this.ListenPort = settings.ListenPort;

            this.ClientUsername = settings.Username;

            this.ClientPassword = settings.Password;
        }