/// <summary> /// 载入渠道demo、测试用例文件信息 /// </summary> private void loadChannelDemoInfos() { configUrl = getAttach_ConfigUrl(); // 获取渠道文件信息 string configInfo = WebSettings.getWebData(configUrl); if (configInfo.Equals("")) { return; } string serverDir = WebSettings.getNodeData(configInfo, "服务器资源目录", true).Trim(); string filesInfo = WebSettings.getNodeData(configInfo, "待更新文件", false).Trim(); string[] files = filesInfo.Replace("\r\n", "\n").Split('\n'); List <string> updateFiles = new List <string>(); // 用于记录更新的文件完整路径信息 foreach (string file0 in files) { string file = file0.Trim().TrimEnd(')'); if (file.Equals("")) { continue; } if (file.StartsWith("配置文件/")) { string channelDir = file.Substring(0, file.LastIndexOf("/")); string[] A = file.Split('/'); if (A.Length > 2) { if (!channels.Contains(A[1])) { channels.Add(A[1]); channelDirs.Add(A[1], channelDir); } else { channelDirs[A[1]] = channelDir; } } } } // 按渠道显示至list列表 listBoxChannel.Items.Clear(); listBoxChannel.Items.AddRange(channels.ToArray()); }
Dictionary <string, string> channelDirs = new Dictionary <string, string>(); // 渠道目录信息, 配置文件/0000843_奇虎360/V1.8.0_546/ /// <summary> /// 获取“待更新资源目录” /// </summary> private string getAttach_ConfigUrl() { string url = ""; string configInfo = WebSettings.getWebData(DependentFiles.ToolUrl); if (!configInfo.Equals("")) { url = WebSettings.getNodeData(configInfo, "待更新资源目录", true).Trim(); } if (url.Equals("")) { MessageBox.Show("配置文件" + DependentFiles.ToolUrl + ",中的“待更新资源目录”为空。\r\n请先配置,再使用此工具"); } return(url); }