zoukankan      html  css  js  c++  java
  • 基于System.Text导入

    public void GetTxT()
    {
    string ACellNameChecked = "";
    string InSysInterAnalyReportWordSavePath;
    ACellNameChecked = InvalidCellNameCharsRemoveForFilePath(AnalysisCellNamecomboBox.Text);
    if (!Directory.Exists(InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)"))
    Directory.CreateDirectory(InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)");
    InSysInterAnalyReportWordSavePath = InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)" + "\" + ACellNameChecked + "网内干扰优化方案.txt";

    StreamReader ParamsTxT = new StreamReader(InSysInterAnalyReportWordSavePath, Encoding.UTF8);
    string SR = "";
    while ((SR = ParamsTxT.ReadLine()) != null)
    {
    List<string> ParamsList = SR.Split(';').ToList();

    for (int i = 0; i < ParamsList.Count; i++)
    {

    if (ParamsList[i].Contains("受扰小区:") ||
    ParamsList[i].Contains("干扰源邻区1:") ||
    ParamsList[i].Contains("干扰源邻区2:") ||
    ParamsList[i].Contains("干扰源邻区3:"))
    {
    Dictionary<string, List<string>> Params = new Dictionary<string, List<string>>();
    for (int j = 0; j < ParamsList.Count/3; j++)
    {
    List<string> list = new List<string>();
    list.Add(ParamsList[1 + j * 3]);
    list.Add(ParamsList[2 + j * 3]);
    list.Add(ParamsList[3 + j * 3]);
    Params.Add(ParamsList[2 + j * 3].Split(':')[0], list);
    }
    DictionaryParamsTxT.Add(ParamsList[i].Split(':')[1], Params);
    }
    }
    }

    ParamsTxT.Close();
    }

  • 相关阅读:
    C++11新特性
    Qt操作xml
    指针和引用的区别
    QT软件主题切换
    常见的临时变量的生成场景
    QQuickWidget+QML设置背景透明
    idea maven Could not transfer artifact
    Java项目启动时执行指定方法的几种方式
    解决bootstrap-table在切换分页后再次查询报错404问题
    bootstrap:表单必填项*标识,及提交前校验
  • 原文地址:https://www.cnblogs.com/SiSui/p/9546992.html
Copyright © 2011-2022 走看看