Пример #1
0
        private async Task MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            OperationResult initResult = SoftContext.Initialize();

            if (!initResult.Successed)
            {
                await SoftContext.ShowMessageAsync("初始化失败", initResult.Message);

                SoftContext.RunStatus  = SoftRunStatus.StartFail;
                Locator.Main.StatusBar = $"初始化失败:{initResult.Message}";
                return;
            }
            Locator.Main.StatusBar = "准备就绪";
        }
Пример #2
0
        private async System.Threading.Tasks.Task MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                // GameLogin game = new GameLogin("huang77", "huang77");
                //game.Login(PlatformLogin.Platform.楚游_070703sy);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            //初始化大漠对象,注册,新建一个大漠对象
            OperationResult initResult = SoftContext.Initialize();

            if (!initResult.Successed)
            {
                await SoftContext.ShowMessageAsync("初始化失败", initResult.Message);

                SoftContext.RunStatus = SoftRunStatus.StartFail;

                Locator.Main.StatusBar = $"初始化失败:{initResult.Message}";

                return;
            }
            else
            {
                Debug.WriteLine("SharpPcap版本:" + SharpPcap.Version.VersionString);
                int i = 0;
                if (File.Exists(@"E:\nox\Nox\bin\nox_adb.exe"))
                {
                    i = 0;
                }
                if (File.Exists(@"E:\Nox\bin\nox_adb.exe"))
                {
                    i = 0;
                }
                CaptureService.GetInstance().StartCapture(i, "host " + SoftContext.ServerIp);

                Locator.Main.StatusBar = "准备就绪";
                return;
            }
        }
Пример #3
0
        private async Task FatalReport(Exception exception)
        {
            if (exception is InvalidCastException && exception.Message.Contains(".Windows.Media.Visual"))
            {
                return;
            }

            if (SoftContext.Progress != null && SoftContext.Progress.IsOpen)
            {
                await Task.Delay(2000);

                await SoftContext.Progress.CloseAsync();
            }
            List <string> lines = new List <string>();

            while (exception != null)
            {
                lines.Add(exception.Message);
                exception = exception.InnerException;
            }
            await SoftContext.ShowMessageAsync("程序错误", $"错误消息:{lines.ExpandAndToString("\r\n---")}");
        }