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

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

    FileStream FS = new FileStream(InSysInterAnalyReportWordSavePath, FileMode.Create);
    StreamWriter SW = new StreamWriter(FS);

    string Box = AnalysisCellNamecomboBox.Text;
    string AcellName = OptimizeDictionaryAl[Box].Keys.ToList()[0];
    string NcellName1 = OptimizeDictionaryAl[Box].Keys.ToList()[1];
    string NcellName2 = OptimizeDictionaryAl[Box].Keys.ToList()[2];
    string NcellName3 = OptimizeDictionaryAl[Box].Keys.ToList()[3];

    StringBuilder ACell = new System.Text.StringBuilder("受扰小区:" + AcellName + ";");
    StringBuilder Ncell1 = new System.Text.StringBuilder("干扰源小区1:" + NcellName1 + ";");
    StringBuilder Ncell2 = new System.Text.StringBuilder("干扰源小区2:" + NcellName2 + ";");
    StringBuilder Ncell3 = new System.Text.StringBuilder("干扰源小区3:" + NcellName3 + ";");


    SW.Write(txt(ACell, Box, AcellName, "a") + " ");
    SW.Write(txt(Ncell1, Box, NcellName1, "b") + " ");
    SW.Write(txt(Ncell2, Box, NcellName2, "a") + " ");
    SW.Write(txt(Ncell3, Box, NcellName3, "b") + " ");

    SW.Flush(); //清空缓冲区
    SW.Close(); //关闭流
    FS.Close();
    }

  • 相关阅读:
    iOS- storyboard this class is not key value coding-compliant for the key xxx
    iOS-iOS 获取蓝色文件夹图片
    新浪微博客户端(45)-显示表情
    新浪微博客户端(44)-分页表情键盘
    iOS-设置UIPageControl 显示图片
    codeforces736D. Permutations(线性代数)
    POJ2505 A multiplication game(博弈)
    BZOJ3073: [Pa2011]Journeys(线段树优化建图 Dijkstra)
    SPOJ KATHTHI
    洛谷P2827 蚯蚓(单调队列)
  • 原文地址:https://www.cnblogs.com/SiSui/p/9506132.html
Copyright © 2011-2022 走看看