Exemplo n.º 1
0
        private void ShowLog(object[] objs)
        {
            if (InvokeRequired)
            {
                Invoke(new DoInMainThread(ShowLog));
                return;
            }
            LogType type    = CopyData.GetLogType((int)objs[0]);
            string  message = (string)objs[1];

            if (UserManager.GetUserManager().GetCurrentUser().IsAdmin())
            {
                LogUtil.LogAdmin(LogTextBox, logFilePath, type, message);
            }
            else
            {
                LogUtil.LogTest(LogTextBox, logFilePath, type, message);
            }
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     //校验参数
     if (args.Length > 1 && CopyData.IsLogType(args[0]) && !string.Empty.Equals(args[1]))
     {
         IntPtr mainWindowPtr = FindWindow(null, MAIN_WINDOW);
         if (mainWindowPtr != IntPtr.Zero)
         {
             COPYDATASTRUCT cds;
             cds.dwData = (IntPtr)CopyData.GetLogType(args[0]);
             cds.lpData = args[1];
             cds.cbData = Encoding.Default.GetBytes(args[1]).Length + 1;
             SendMessage(mainWindowPtr, CopyData.WM_COPYDATA, CopyData.MSG_TYPE_LOG, ref cds);
         }
         else
         {
             Console.WriteLine("window not found");
         }
     }
     else
     {
         Console.WriteLine("param error");
     }
 }