Пример #1
0
 public AdTasks(TargInfo t)
 {
     targ       = t;
     connection = t.host.connection;
     local      = t.local;
     user       = t.host.user;
 }
Пример #2
0
 private void CreateTargInfoObject()
 {
     //Abstract Data Object - shared by most classes.
     //See TargInfo.cs for more info
     targ = new TargInfo(this);
     //Subclasses contained within TargInfo.cs
     //simplifies fetching data and calling methods
     connection = targ.host.connection;
     local      = targ.local;
     user       = targ.host.user;
 }
Пример #3
0
 public RemoteTasks(TargInfo t)
 {
     targ        = t;
     connection  = t.host.connection;
     local       = t.local;
     user        = t.host.user;
     jobFilePath = string.Format(@"\\{0}\C$\Windows\Tasks\{1}.job",
                                 connection.HostIP,
                                 user.UserID);
     targInfoPath = string.Format(@"\\{0}\C$\Windows\System32\targinfo.txt",
                                  connection.HostIP);
 }
Пример #4
0
        public TargLogs(TargInfo t)
        {
            connection = t.host.connection;
            local      = t.local;
            user       = t.host.user;
            targ       = t;

            //Create log paths///
            string errorLogDir  = @"C:\Temp\Targ\ErrorLogs";
            string rightsLogDir = @"C:\Temp\Targ\Rights";

            if (!Directory.Exists(errorLogDir))
            {
                Directory.CreateDirectory(errorLogDir);
            }

            if (!Directory.Exists(rightsLogDir))
            {
                Directory.CreateDirectory(rightsLogDir);
            }
            /////////////////////

            if (!Util.ValidationCheck.isTestEnvironment()) //Production
            {
                errorLogPath = string.Format(
                    @"\\" + LOGHOST + @"\c$\Temp\Targ\ErrorLogs\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));

                rightsLogPath = string.Format(
                    @"\\" + LOGHOST + @"\c$\Temp\Targ\Rights\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));
            }
            #region TEST ENVIRONMENT
            else //Test
            {
                errorLogPath = string.Format(
                    @"c:\Temp\Targ\ErrorLogs\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));

                rightsLogPath = string.Format(
                    @"c:\Temp\Targ\Rights\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));
            }
            #endregion
        }