zoukankan      html  css  js  c++  java
  • 以当前系统默认的编码写入文件

    FilePatch = Path.Combine(movie.SaveFolderPatch, "电影资料.txt");
                        FileInfo fi = new FileInfo(FilePatch);
                        if (fi.Exists)
                            fi.Delete();
                        FileStream fs = File.Open(FilePatch, FileMode.OpenOrCreate, FileAccess.Write);
                        textSave = "[影片主演]";
                        textSave += crlf;
                        textSave += "主演=" + movie.Actor;
                        textSave += crlf;
                        textSave += "\r";
                        textSave += crlf;
                        textSave += "[影片类型]";
                        textSave += crlf;
                        textSave += "地区=" + movie.wherefrom.ToString();
                        textSave += crlf;
                        textSave += "清晰度=" + movie.ProgNotes;
                        textSave += crlf;
                        textSave += "类型=" + movie.TypeName;
                        textSave += crlf;
                        textSave += "\r";
                        textSave += crlf;
                        textSave += "[选填部分]";
                        textSave += crlf;
                        textSave += "推荐设定=" + movie.Recommend.ToString();
                        textSave += crlf;
                        textSave += "等级设定=" + movie.ProgLevel.ToString();
                        textSave += crlf;
                        textSave += "温馨提示=";
                        textSave += crlf;
                        textSave += "\r";
                        textSave += crlf;
                        textSave += "[影片介绍]";
                        textSave += crlf;
                        textSave += movie.Synopsis;
                        textSave += crlf;
                        Byte[] info = Encoding.Default.GetBytes(textSave);
                        fs.Write(info, 0, info.Length);
                        fs.Close();
    

      

  • 相关阅读:
    JS函数
    函数与指针
    函数返回指针类型(strchr函数)
    二维数组求平均值(指针的使用)
    二维数组做函数参数传递
    指针与函数
    Ubuntu安装mysql步骤
    带参程序
    函数返回值是指针
    mystrcat
  • 原文地址:https://www.cnblogs.com/ChangTan/p/2323113.html
Copyright © 2011-2022 走看看