示例#1
0
        public LogFile(string startupPath, string logVariablesPath)
        {
            Directory.CreateDirectory(@".\LogFiles\");
            this.startupPath     = startupPath;
            this.LogVariablePath = logVariablesPath;

            logVariables = new VariableStorage(logVariablesPath);
            ObjStr       = new ObjectStream(startupPath);
            object id = logVariables.GetVariable("Id");

            if (id != null)
            {
                Id = Int32.Parse(id.ToString());
            }
        }
示例#2
0
        public LogFile()
        {
            Directory.CreateDirectory(@".\LogFiles\");
            this.startupPath     = System.IO.Path.GetFullPath(@".\LogFiles\test1.txt");
            this.LogVariablePath = Path.GetFullPath(@".\LogFiles\logV");

            logVariables = new VariableStorage(LogVariablePath);
            ObjStr       = new ObjectStream(startupPath);

            object id = logVariables.GetVariable("Id");

            if (id != null)
            {
                Id = Int32.Parse(id.ToString());
            }
        }
        public VariableStorage(string filePath)
        {
            this.filePath = filePath ?? throw new ArgumentNullException("Argument at pos: 1, not null.");

            fileStream = new ObjectStream(filePath);
        }