Пример #1
0
 /*
  * Returns the {@code boolean} value of the system property identified by
  * {@code string}.
  *
  * @param string
  *            the name of the requested system property.
  * @return {@code true} if the system property named by {@code string}
  *         exists and it is equal to "true" using case insensitive
  *         comparison, {@code false} otherwise.
  * @see System#getProperty(String)
  */
 public static bool getBoolean(String s)
 {
     if (s == null || s.length() == 0)
     {
         return(false);
     }
     return(parseBoolean(SystemJ.getProperty(s)));
 }
Пример #2
0
        public Process exec(String[] cmdArray, String[] env, java.io.File dir)
        {
            Process p = new Process();

            p.StartInfo.WorkingDirectory = (null != dir) ? dir.toString() : SystemJ.getProperty("user.dir");
            p.StartInfo.FileName         = cmdArray[0];
            for (int i = 0; i < env.Length; i++)
            {
                String [] keyValue = env [i].Split('=');
                p.StartInfo.EnvironmentVariables.Add(keyValue[0], keyValue[1]);
            }
            for (int i = 1; i < cmdArray.Length; i++)
            {
                p.StartInfo.Arguments.Insert(i - 1, cmdArray[i]);
            }
            p.StartInfo.UseShellExecute = true;
            p.Start();
            return(p);
        }