| | |
| | | } |
| | | } |
| | | |
| | | //在指定代码上方插入 |
| | | //public void WriteAbove(string below,string text) |
| | | //{ |
| | | // StreamReader streamReader = new StreamReader(filePath); |
| | | // string text_all = streamReader.ReadToEnd(); |
| | | // streamReader.Close(); |
| | | |
| | | // int beginIndex = text_all.IndexOf(below, System.StringComparison.CurrentCulture); |
| | | // if (beginIndex == -1) |
| | | // { |
| | | // Debug.LogError(filePath + "中没有找到标致" + below); |
| | | // return; |
| | | // } |
| | | |
| | | // int endIndex = text_all.LastIndexOf("\n", beginIndex + below.Length, System.StringComparison.CurrentCulture); |
| | | |
| | | // text_all = text_all.Substring(0, endIndex) + "\n" + text + "\n" + text_all.Substring(endIndex); |
| | | |
| | | // StreamWriter streamWriter = new StreamWriter(filePath); |
| | | // streamWriter.Write(text_all); |
| | | // streamWriter.Close(); |
| | | //} |
| | | |
| | | //在指定代码下方插入 |
| | | public void WriteBelow(string below, string text) |
| | | { |
| | | StreamReader streamReader = new StreamReader(filePath); |