コード例 #1
0
ファイル: quota_form.cs プロジェクト: itsrb/Migrate-Quota
        private void send_command(Quota q)
        {
            string windir = Environment.GetEnvironmentVariable("WINDIR");

               // System.Diagnostics.Process.Start(@"\Sysnative\dirquota.exe");

            //System.Diagnostics.Process.Start(@"c:\windows\system32\dirquota.exe");
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = windir+"\\Sysnative\\dirquota.exe";
            p.StartInfo.Arguments = "quota add /path:\""+q.newPath+"\" /SourceTemplate:\""+q.template.Replace(getParameter(parameter.templatematch.ToString()),"").Trim()+"\" /Remote:"+server.Text+"";
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow = true;

            string sOutput;

            p.Start();
            StreamReader reader = p.StandardOutput;
            q.pushResult = reader.ReadToEnd();

            p.WaitForExit();
            q.pushed = p.ExitCode != 0 ? false : true;
            //MessageBox.Show(p.ExitCode.ToString());
            p.Close();
            //MessageBox.Show(sOutput);

            //dirquota quota add /path:"e:\Gruppen\PSK-Z Scherenarm 9mm" /SourceTemplate:"SIAU 02 GB-Grenze Gruppen" /Remote:FSHK1-32
        }
コード例 #2
0
ファイル: quota_form.cs プロジェクト: itsrb/Migrate-Quota
        private void pushData(ArrayList head, ArrayList row)
        {
            Quota q = new Quota();

            q.limit     = row[head.IndexOf(getParameter(parameter.limit.ToString()))].ToString();
            q.path      = row[head.IndexOf(getParameter(parameter.path.ToString()))].ToString();
            q.template  = row[head.IndexOf(getParameter(parameter.template.ToString()))].ToString();

            quotas.Add(q);
        }