private void MenuButton_Setting_Click(object sender, RoutedEventArgs e)
        {
            Window test = new windows.InitSetting();

            test.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            test.Owner = this;
            bool result = test.ShowDialog().Value;
        }
        public MainWindow()
        {
            main = this;
            if (!System.IO.Directory.Exists(MyInfo.myDataPath))
            {
                //Console.WriteLine(MyInfo.myDataPath);
                System.IO.Directory.CreateDirectory(MyInfo.myDataPath);
                //Console.WriteLine(MyInfo.iconFolder);
                System.IO.Directory.CreateDirectory(MyInfo.iconFolder);
                //Console.WriteLine(MyInfo.myDataPath + "\\MediaLibraryTemp");
                System.IO.Directory.CreateDirectory(MyInfo.myDataPath + "\\MediaLibraryTemp");
                System.IO.File.Copy(System.Windows.Forms.Application.StartupPath + "./AreaParty.exe.config", MyInfo.execonfig);
            }

            if (System.IO.File.Exists(MyInfo.execonfig))
            {
                AppConfig.Change(MyInfo.execonfig);
            }
            if (String.IsNullOrEmpty(PairCodeConfig.GetPairCode()))
            {
                bool result = new PairCodeWindow().ShowDialog().Value;

                if (result == false)
                {
                    System.Windows.Application.Current.Shutdown();
                    System.Windows.Forms.Application.Exit();
                }
            }
            Thread t = new Thread(new ThreadStart(Run));

            t.Name         = "NoParameterThread";
            t.IsBackground = true;
            t.Start();

            if (ConfigUtil.GetValue("init").Equals("false"))
            {
                windows.InitSetting ist = new windows.InitSetting();
                ist.ShowDialog();
                AppScan.ScanAndUpdateMySoftware();
                util.JAVAUtil.AddSourceToHTTP(info.MyInfo.iconFolder);
                ConfigUtil.SetValue("init", "true");
            }
            function.webservice.WebOperation.ReportInfo();
            function.webservice.WebOperation.GetUudateInfo();
            InitializeComponent();
            new Thread(new ThreadStart(delegate()
            {
                if (ConfigUtil.GetValue("longconnect").Equals("true"))
                {
                    try
                    {
                        Thread.Sleep(1000 * 10);
                        IPAddress ip  = IPAddress.Parse("127.0.0.1");
                        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                        socket.Connect(new IPEndPoint(ip, ConfigResource.HOLE_PORT));
                        string name     = ConfigUtil.GetValue("username");
                        string password = ConfigUtil.GetValue("password");
                        Command c       = CommandFactory.GetLoginCommand(name, password);
                        socket.Send(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(c)));
                        socket.Send(Encoding.UTF8.GetBytes("\r\n"));
                        socket.Close();
                        App.Current.Dispatcher.Invoke((Action)(() =>
                        {
                            this.Login_Label.Content = "长连接开启";
                        }));
                    }
                    catch (Exception e)
                    {
                        App.Current.Dispatcher.Invoke((Action)(() =>
                        {
                            this.Login_Label.Content = "长连接失败";
                        }));

                        Console.WriteLine(e);
                    }
                }
            })).Start();

            Icon();
            //MessageBox.Show("" + ConfigUtil.IsExistsScreen("user"));
        }