예제 #1
0
        private void InitializeLstView()
        {
            string[] tempLst = null;
            bool     result  = _client.TLoginUpdateSys(out tempLst, out _deleteLst, out _fileContent);

            if (result)
            {
                //添加删除列表
                if (_deleteLst != null && _deleteLst.Length > 0)
                {
                    lvUpdateList.Items.Add(new ListViewItem(new string[] { "文件删除个数:" + _deleteLst.Length, "", "0%" }));
                }

                //添加更新列表
                List <string> lstFile = new List <string>();
                foreach (string item in tempLst)
                {
                    string[] arr = item.Split(';');
                    if (arr != null && arr.Length > 1)
                    {
                        string[] fileTemp = arr[0].Split('\\');
                        lvUpdateList.Items.Add(new ListViewItem(new string[] { fileTemp[fileTemp.Length - 1], arr[1], "0%" }));
                        lstFile.Add(arr[0]);
                    }
                }
                _fileLst = lstFile.ToArray();
            }
            else
            {
                lbState.Text = "获取更新文件失败!";
            }
            btnFinish.Enabled = !result;
            btnNext.Enabled   = result;
        }