public static void Update3dsdbXMLFile() { FileInfo l3dsdb = new FileInfo(Path.Combine(BQDirectory.DBDir, _3dsreleasesFileName)); BQLog.WriteMsgToUI("开始更新3dsrelease.xml"); if (!l3dsdb.Exists) { BQLog.WriteMsgToUI("开始从3dsdb.com下载"); BQWeb.DownloadWebFile(URL3dsdb, l3dsdb); } else { FileInfo l3dsdbNew = new FileInfo(l3dsdb.FullName + "new"); if (l3dsdbNew.Exists) { BQLog.WriteMsgToUI("删除上次残留的3dsrelease.xml文件"); l3dsdbNew.Delete(); } BQLog.WriteMsgToUI("开始从3dsdb.com下载"); BQWeb.DownloadWebFile(URL3dsdb, l3dsdbNew); l3dsdb.Delete(); l3dsdbNew.MoveTo(l3dsdb.FullName); } BQLog.WriteMsgToUI("3dsrelease.xml更新成功"); }
private static FileInfo SavePic(string pUrl) { // http://art.gametdb.com/3ds/coverM/JA/AVSJ.jpg string[] lInfoList = pUrl.Split('/'); string lFileName = lInfoList[lInfoList.Length - 1]; string lFolderName = lInfoList[lInfoList.Length - 3] + "\\" + lInfoList[lInfoList.Length - 2]; FileInfo fileInfo = new FileInfo(Path.Combine(BQDirectory.ConverDir, lFolderName, lFileName)); if (fileInfo.Exists) { return(fileInfo); } if (Directory.Exists(fileInfo.DirectoryName) == false) { Directory.CreateDirectory(fileInfo.DirectoryName); } BQWeb.DownloadWebFile(pUrl, fileInfo); return(fileInfo); }