public void HFSHttpGetFileTest() { string strUrl = "http://192.168.2.19:8008/SK3000ClientRemoteUpdate/Trunk"; string strLocalPath = @"C:\Users\Administrator\Desktop\新建文件夹 (3)"; bool bolResult = Common_Web.HFSHttpGetFile(strUrl, strLocalPath); Assert.IsTrue(bolResult); }
public void HFSHttpGetFileTest1() { string Temp_str = "http://192.168.2.19:8008/SK3000ClientRemoteUpdate/Trunk/FileVerInfo.xml"; string Temp_str1 = @"C:\Users\thankyou_1996\Desktop\新建文件夹 (2)\FileVerInfo.xml"; HFSDownLoadFileInfo h = new HFSDownLoadFileInfo { DownName = Temp_str, SaveName = Temp_str1 }; bool bolResule = Common_Web.HFSHttpGetFile(h); Assert.IsTrue(bolResule); }
public void HFSHttpFileTest() { //先对比得出要添加或更新的东西 string XMLFileName = @"C:\Users\Administrator\Desktop\新建文件夹 (2)\FileVerInfo.xml"; //服务器上的XML文件 List <SKFileInfo> sKFileInfos = FileOperat.GetSKFileInfoList_ByXmlFilePath(XMLFileName); XMLFileName = @"C:\Users\Administrator\Desktop\FileVerInfo.xml"; //本地的XML文件 List <SKFileInfo> sKFileInfos1 = FileOperat.GetSKFileInfoList_ByXmlFilePath(XMLFileName); string Key = "name"; string[] Contrasts = { "path", "fileversion", "size" }; List <SKFileInfo> returnList = FileOperat.ContrastSKFileInfo(sKFileInfos, sKFileInfos1, Key, Contrasts); //获取HFS文件列表 string strUrl = "http://192.168.2.19:8008/SK3000ClientRemoteUpdate/Trunk"; //获取的链接 string strLocalPath = @"C:\Users\Administrator\Desktop\新建文件夹 (4)"; //下载到本地的路径 List <HFSDownLoadFileInfo> result = Common_Web.HFSHttpGetFileNameList(strUrl); //对比查出要下载的列表 List <HFSDownLoadFileInfo> DownList = new List <HFSDownLoadFileInfo>(); foreach (SKFileInfo SKFile in returnList) { foreach (HFSDownLoadFileInfo HFSFile in result) { //if (SKFile.path.Replace(@".\", "").Replace(@"\", "/") == HFSFile.SaveName) if (SKFile.path == HFSFile.SaveName) { HFSFile.SaveName = strLocalPath + "/" + HFSFile.SaveName; HFSFile.DownName = strUrl + "/" + HFSFile.DownName; DownList.Add(HFSFile); break; } } } //下载文件列表 if (DownList != null && DownList.Count > 0) { bool bolResult = Common_Web.HFSHttpGetFile(DownList); } }