コード例 #1
0
ファイル: Form_login.cs プロジェクト: ezrealik/ZElauncher
 private void pictureBox_Logo_MouseDown(object sender, MouseEventArgs e)
 {
     //为当前应用程序释放鼠标捕获
     WIN32API.ReleaseCapture();
     //发送消息 让系统误以为在标题栏上按下鼠标
     WIN32API.SendMessage((IntPtr)this.Handle, WIN32API.VM_NCLBUTTONDOWN, WIN32API.HTCAPTION, 0);
 }
コード例 #2
0
ファイル: Form_Setting.cs プロジェクト: ezrealik/ZElauncher
 private void Form_Setting_Load(object sender, EventArgs e)
 {
     textBox_SteamPath.Text = _form1.GetSteamPath();
     textBox_CSGOPath.Text  = _form1.GetCSGOPath();
     try
     {
         System.IO.StreamReader st;
         st = new System.IO.StreamReader(textBox_CSGOPath.Text + @"\csgo\cfg\bind.cfg", System.Text.Encoding.UTF8);
         //UTF-8通用编码
         textBox_KeyCmd.Text = st.ReadToEnd();
         st.Close();
         StringBuilder rew = new StringBuilder(25);
         WIN32API.GetPrivateProfileString("Key", "bind", null, rew, 25, Application.StartupPath + "\\Config.ini");
         if (rew.ToString() == "true")
         {
             checkBox_BindKey.Checked = true;
         }
         else
         {
             checkBox_BindKey.Checked = false;
         }
     }
     catch
     {
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: ezrealik/ZElauncher
 //获取CSGO目录
 private void InitCSGOPath()
 {
     try
     {
         StringBuilder Stream = new StringBuilder(1024);
         WIN32API.GetPrivateProfileString("Steam", "CSGOPath", null, Stream, 1024, Application.StartupPath + "\\Config.ini");
         if (File.Exists(Stream.ToString() + @"\csgo.exe"))
         {
             GCSGOPath = Stream.ToString();
             return;
         }
         WIN32API._GetCSGOPath(Stream, 1024);
         GCSGOPath = Stream.ToString();
         if (File.Exists(GCSGOPath.ToString() + @"\csgo.exe"))
         {
             label_DebugOutPut.Text = "获取CSGO目录失败!!";
             return;
         }
         WIN32API.WritePrivateProfileString("Steam", "CSGOPath", GCSGOPath, Application.StartupPath + "\\Config.ini");
     }
     catch (Exception e)
     {
         label_DebugOutPut.Text = e.Message.ToString();
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: ezrealik/ZElauncher
 //获取Steam目录
 private void InitSteamPath()
 {
     try
     {
         StringBuilder SteamPath = new StringBuilder(1024);
         WIN32API.GetPrivateProfileString("Steam", "Path", null, SteamPath, 1024, Application.StartupPath + "\\Config.ini");
         if (SteamPath.Length > 5)
         {
             GSteamPath = SteamPath.ToString();
             return;
         }
         string      registData;
         RegistryKey hkml     = Registry.LocalMachine;
         RegistryKey software = hkml.OpenSubKey("SOFTWARE", false);
         RegistryKey aimdir   = software.OpenSubKey("Classes\\steam\\Shell\\Open\\Command", false);
         registData = aimdir.GetValue(null).ToString();
         string[] sArray = Regex.Split(registData, "\"", RegexOptions.IgnoreCase);
         GSteamPath = sArray[1].ToString();
         WIN32API.WritePrivateProfileString("Steam", "Path", GSteamPath, Application.StartupPath + "\\Config.ini");
     }
     catch (Exception e)
     {
         label_DebugOutPut.Text = e.Message.ToString();
     }
 }
コード例 #5
0
ファイル: Form_login.cs プロジェクト: ezrealik/ZElauncher
 private void panel3_MouseDown(object sender, MouseEventArgs e)
 {
     //判断是否标题栏区域
     if (e.Y < 45 && e.X < 335)
     {
         //为当前应用程序释放鼠标捕获
         WIN32API.ReleaseCapture();
         //发送消息 让系统误以为在标题栏上按下鼠标
         WIN32API.SendMessage((IntPtr)this.Handle, WIN32API.VM_NCLBUTTONDOWN, WIN32API.HTCAPTION, 0);
     }
 }
コード例 #6
0
ファイル: Form_MainPage.cs プロジェクト: ezrealik/ZElauncher
 //国服/国际服模式
 private void checkBox_CN_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox_CN.Checked == false)
     {
         WIN32API.WritePrivateProfileString("Steam", "IsChina", "False", Application.StartupPath + "\\Config.ini");
     }
     else
     {
         WIN32API.WritePrivateProfileString("Steam", "IsChina", "True", Application.StartupPath + "\\Config.ini");
     }
 }
コード例 #7
0
ファイル: Form_Setting.cs プロジェクト: ezrealik/ZElauncher
 private void checkBox_BindKey_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox_BindKey.Checked)
     {
         WIN32API.WritePrivateProfileString("Key", "bind", "true", Application.StartupPath + "\\Config.ini");
         if (isor)
         {
             MessageBox.Show("已开启按键绑定,如果没有效果,请打开控制台输入[\"exec bind\"]手动激活按键!");
         }
         isor = true;
     }
     else
     {
         isor = true;
         WIN32API.WritePrivateProfileString("Key", "bind", "false", Application.StartupPath + "\\Config.ini");
     }
 }
コード例 #8
0
ファイル: Form_MainPage.cs プロジェクト: ezrealik/ZElauncher
 //启动游戏
 private void LauncherGame(string IPO)
 {
     if (WIN32API.IsProcessExist("csgo"))
     {
         Process.Start("steam://connect/" + IPO, null);
         _form1.SetDebugString(string.Format("小X加入[{0}]服务器队列啦,[Master]游戏愉快(~o ̄▽ ̄)~o", IPO));
     }
     else
     {
         string r;
         if (checkBox_CN.Checked)
         {
             StringBuilder rew = new StringBuilder(25);
             WIN32API.GetPrivateProfileString("Key", "bind", null, rew, 25, Application.StartupPath + "\\Config.ini");
             if (rew.ToString() == "true")
             {
                 r = string.Format("-applaunch 730 -perfectworld -novid +exec bind +connect {0}", IPO);
             }
             else
             {
                 r = string.Format("-applaunch 730 -perfectworld -novid +connect {0}", IPO);
             }
         }
         else
         {
             StringBuilder rew = new StringBuilder(25);
             WIN32API.GetPrivateProfileString("Key", "bind", null, rew, 25, Application.StartupPath + "\\Config.ini");
             if (rew.ToString() == "true")
             {
                 r = string.Format("-applaunch 730 -worldwide -novid +exec bind +connect {0}", IPO);
             }
             else
             {
                 r = string.Format("-applaunch 730 -worldwide -novid +connect {0}", IPO);
             }
         }
         Process.Start(_form1.GetSteamPath(), r);
         Sleep(3000);
         _form1.SetDebugString(string.Format("小X终于挤进[{0}]服务器队列啦,[Master]游戏愉快(~o ̄▽ ̄)~o", IPO));
     }
     label_ServerTick.Text = "服务器队列中";
 }
コード例 #9
0
ファイル: Form_MainPage.cs プロジェクト: ezrealik/ZElauncher
        private void Form_MainPage_Load(object sender, EventArgs e)
        {
            StringBuilder CnCheck = new StringBuilder(70);

            WIN32API.GetPrivateProfileString("Steam", "IsChina", null, CnCheck, 70, Application.StartupPath + "\\Config.ini");
            if (string.Compare(CnCheck.ToString(), "False") == 0)
            {
                checkBox_CN.Checked = false;
            }
            else
            {
                checkBox_CN.Checked = true;
            }
            //初始化服务器列表
            listView_Server.Columns.Add("服务器名");
            listView_Server.Columns[0].Width = 300;
            listView_Server.Columns.Add("地图名");
            listView_Server.Columns[1].Width = 150;
            listView_Server.Columns.Add("人数");
            listView_Server.Columns.Add("IP:端口");
            listView_Server.Columns[3].Width = 100;
            listView_Server.Columns.Add("地区");
            listView_Server.Columns[4].Width = 80;
            WIN32API.GetPrivateProfileString("Config", "ServerMode", null, CnCheck, 70, Application.StartupPath + "\\Config.ini");
            if (string.Compare(CnCheck.ToString(), "") == 1)
            {
                ServerMode = CnCheck.ToString();
            }
            else
            {
                ServerMode = "all";
            }
            InitServerListInfo(ServerMode);
            //服务器列表刷新定时器;
            time_RefreshServer.Enabled  = true;
            time_RefreshServer.Interval = 15 * 1000;//15Secound;
            time_RefreshServer.Tick    += new EventHandler(ServerRefreshEvent);
            time_RefreshServer.Start();
            InitSteamPath();
            RefreshMyInfo();
        }
コード例 #10
0
ファイル: Form_Setting.cs プロジェクト: ezrealik/ZElauncher
        private void button2_Click(object sender, EventArgs e)
        {
            //CSGO目录浏览
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Multiselect = false;
            dialog.Title       = "请选择CSGO文件";
            dialog.Filter      = "可执行文件(*.exe)|*.exe|所有文件(*.*)|*.*";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                StringBuilder sr = new StringBuilder(1024);
                sr.Append(dialog.FileName);
                WIN32API._DeleteSuffix(sr, '\\');
                if (File.Exists(sr.ToString() + "\\csgo.exe"))
                {
                    textBox_CSGOPath.Text = sr.ToString();
                    _form1.SetCSGOPath(textBox_CSGOPath.Text);
                    WIN32API.WritePrivateProfileString("Steam", "CSGOPath", textBox_CSGOPath.Text, Application.StartupPath + "\\Config.ini");
                }
            }
        }
コード例 #11
0
ファイル: Form1.cs プロジェクト: ezrealik/ZElauncher
 //CSGO目录获取定时器线程
 private void time_csgo_event(object sender, EventArgs e)
 {
     label_DebugOutPut.Text = "CSGO线程检测运行中,正在等待CSGO进程运行....";
     try
     {
         StringBuilder Csgo = new StringBuilder(1024);
         if (WIN32API._GetProcessCSGOPath(Csgo, 1024))
         {
             if (File.Exists(Csgo.ToString() + @"\csgo.exe"))
             {
                 GCSGOPath = Csgo.ToString();
                 time_csgo.Stop();
                 WIN32API.WritePrivateProfileString("Steam", "CSGOPath", GCSGOPath, Application.StartupPath + "\\Config.ini");
                 label_DebugOutPut.Text = "成功获取到CSGO目录路径!";
             }
         }
     }
     catch (System.Exception ex)
     {
         label_DebugOutPut.Text = ex.Message.ToString();
     }
 }
コード例 #12
0
ファイル: Form_MapInfo.cs プロジェクト: ezrealik/ZElauncher
        private void InitMapList(string Type)
        {
            try
            {
                //变量
                string Result;
                byte[] bjson;
                JArray jar;
                listView_Map.Items.Clear();
                _form1.SetDebugString("正在搜索地图中,请耐心等待......");
                switch (Type)
                {
                case "ze/zm":
                    #region 僵尸逃跑/感染
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/ze.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString()); //获取数组节点
                        int     index = listView_Map.Items.Count;         //获取数组值
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/zm.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString()); //获取数组节点
                        int     index = listView_Map.Items.Count;         //获取数组值
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    #endregion
                    break;

                case "mg/hg/de":
                    #region 对抗/混战/死斗
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/mgdk.html");
                    //字符转换;
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析;
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点;
                        //获取数组值;
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/hg.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点
                                                                             //获取数组值
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/csde.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点
                                                                             //获取数组值
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    #endregion
                    break;

                case "awp":
                    #region AWP
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/awp.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString()); //获取数组节点
                        int     index = listView_Map.Items.Count;         //获取数组值
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    #endregion
                    break;

                case "ttt/jb":
                    #region 越狱/叛徒
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/ttt.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString()); //获取数组节点
                        int     index = listView_Map.Items.Count;         //获取数组值
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/jb.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString()); //获取数组节点
                        int     index = listView_Map.Items.Count;         //获取数组值
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    #endregion
                    break;

                case "kz/bhop/surf":
                    #region kz/bhop/surf
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/kz.html");
                    //字符转换;
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析;
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点;
                        //获取数组值;
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/bhop.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点
                                                                             //获取数组值
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    Result = WIN32API.GetContentFromUrl("http://xnetsoft2.93x.net:9295/mapdata/surf.html");
                    //字符转换
                    bjson  = Encoding.GetEncoding("GBK").GetBytes(Result);
                    Result = Encoding.GetEncoding("GBK").GetString(bjson);
                    jar    = JArray.Parse(Result); //数组解析
                    for (int i = 0; i < jar.Count; i++)
                    {
                        JObject tempo = JObject.Parse(jar[i].ToString());    //获取数组节点
                                                                             //获取数组值
                        int index = listView_Map.Items.Count;
                        listView_Map.Items.Add(tempo["mapname"].ToString());
                        listView_Map.Items[index].SubItems.Add(tempo["type"].ToString());
                        long DateTime;
                        long.TryParse(tempo["timestamp"].ToString(), out DateTime);
                        listView_Map.Items[index].SubItems.Add(WIN32API.UnixToDateTime(tempo["timestamp"].ToString()));
                        listView_Map.Items[index].SubItems.Add(WIN32API.GetSizeKB(tempo["size"].ToString()));
                        if (File.Exists(_form1.GetCSGOPath() + @"\csgo\maps\" + tempo["mapname"].ToString() + ".bsp"))
                        {
                            listView_Map.Items[index].SubItems.Add("已存在");
                        }
                        else
                        {
                            listView_Map.Items[index].SubItems.Add("需要下载");
                        }
                        listView_Map.Items[index].SubItems.Add(tempo["download"].ToString());
                    }
                    #endregion
                    break;

                default:
                    break;
                }
                _form1.SetDebugString(string.Format("当前地图数量[{0}],已完成地图搜索", listView_Map.Items.Count));
            }
            catch (Exception ex)
            {
                _form1.SetDebugString(ex.Message.ToString());
            }
        }
コード例 #13
0
ファイル: Form_MainPage.cs プロジェクト: ezrealik/ZElauncher
 private void SaveServerMode()
 {
     WIN32API.WritePrivateProfileString("Config", "ServerMode", ServerMode, Application.StartupPath + "\\Config.ini");
 }