public static void LoadConfig() { if (S_AllChannelConfig.Count > 0) { return; } string path = S_RootPath + @"/Config.ini"; if (!HS_File.Exists(path)) { throw new System.MissingFieldException("配置文件丢失"); } HS_Config.GetInstance().LoadConfigINI(HS_File.ReadAllBytes(path)); for (int i = 0; i < 100; ++i) { string section = string.Format("Channel_{0}", i); if (!HS_Config.GetInstance().ContainsSection(section)) { break; } ChannelConfig config; config.platform = HS_Config.GetInstance().GetValue(section, "platform"); config.packerName = HS_Config.GetInstance().GetValue(section, "packername"); config.channel = HS_Config.GetInstance().GetValue(section, "channel"); if (string.IsNullOrEmpty(config.channel)) { throw new System.NullReferenceException("配置文件 " + section); } config.defineSymbols = HS_Config.GetInstance().GetValue(section, "definesymbols"); S_AllChannelConfig.Add(config.channel, config); } }
/// <summary> /// 移除SVN资源 /// </summary> private static void RemoveSVNResources() { for (int i = s_CopyFolder.Count - 1; s_CopyFolder.Count > 0 && i >= 0; --i) { HS_Base.SystemDeleteFolder(s_CopyFolder[i]); } HS_File.Delete(Application.streamingAssetsPath + @"/Mainfest.data"); }
/// <summary> /// 删除当前目录下想所有文件 保留当前目录 /// </summary> /// <param name="strPath"></param> /// <returns></returns> public static bool DeleteDir(string path) { #if UNITY_WINDOWS try { // 清除空格 //strPath = @strPath.Trim().ToString(); // 判断文件夹是否存在 if (HS_Directory.Exists(path)) { // 获得文件夹数组 string[] strDirs = System.IO.Directory.GetDirectories(path); // 获得文件数组 string[] strFiles = System.IO.Directory.GetFiles(path); // 遍历所有子文件夹 foreach (string strFile in strFiles) { System.IO.File.Delete(strFile); HS_File.Delete(strFile); } // 遍历所有文件 foreach (string strdir in strDirs) { // 删除文件 System.IO.Directory.Delete(strdir, true); } } // 成功 return(true); } catch (Exception Exp) // 异常处理 { // 异常信息 D.LogError(Exp.ToString()); return(false); } #else return(true); #endif }
static private void FilterEditorDLL(FilterEditorDLLModel model) { string rootPath = S_RootPath; rootPath = rootPath.Replace("\\", "/"); string dll = rootPath + "/Assets/Plugins/HSEngineEditor.dll"; string destDll = rootPath + "/" + HS_Path.GetFileName(dll); if (model == FilterEditorDLLModel.Backups2Assets) { string temp = destDll; destDll = dll; dll = temp; } if (HS_File.Exists(dll)) { FileUtil.CopyFileOrDirectory(dll, destDll); FileUtil.DeleteFileOrDirectory(dll); AssetDatabase.Refresh(); } }
// Use this for initialization void Start() { HS_File.ReadAllText(@"F:/Work247/DotaClient/StreamingAssets/Mainfest.data"); }
// Use this for initialization void Start() { //HS_Config.GetInstance().LoadConfigINI(configFile); HS_File.WriteAllBytes("c://asdsa//asda//asda//a.txt", new byte[] { 1, 1 }); }