예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Text"></param>
        /// <param name="Caption"></param>
        /// <param name="isDelay">是否倒计时</param>
        /// <returns></returns>
        public static DialogResult Show(string Text, string Caption, bool isDelay)
        {
            MessageBoxB  Dlg    = new MessageBoxB(Text, Caption, isDelay);
            DialogResult Result = Dlg.ShowDialog();

            Dlg.Dispose();
            return(Result);
        }
예제 #2
0
 /// <summary>
 /// 运行外部EXE程序
 /// </summary>
 /// <param name="strFilePath">执行文件路径</param>
 /// <param name="processName">进程名字</param>
 public static void RunOtherExe(string strFilePath, string processName)
 {
     string[] _strFilePath = strFilePath.Split(' ');
     if (_strFilePath != null && _strFilePath.Length > 0)
     {
         strFilePath = Function.File.GetPhyPath(_strFilePath[0]);
     }
     else
     {
         strFilePath = Function.File.GetPhyPath(strFilePath);
     }
     Process[] processes = Process.GetProcessesByName(processName);
     if (processes.Length > 0)
     {
         Win32Api.ShowWindow((int)processes[0].MainWindowHandle, 1);
         Win32Api.SetForegroundWindow((int)processes[0].MainWindowHandle);
         return;
     }
     System.Diagnostics.Process pHand = null;
     pHand = new System.Diagnostics.Process();
     pHand.StartInfo.FileName        = strFilePath;
     pHand.StartInfo.UseShellExecute = false;
     if (_strFilePath != null && _strFilePath.Length > 1)
     {
         pHand.StartInfo.Arguments = _strFilePath[1];
     }
     //pHand.StartInfo.UserName = processName;
     try
     {
         pHand.Start();
     }
     catch (Exception e)
     {
         //GlobalUnit.g_MsgControl.OutMessage(e.Message,false, CLDC_Comm.Enum.Cus_MessageType.提示消息);
         MessageBoxB.Show(e.Message, "提示消息");
     }
 }