genOfx() 공개 메소드

public genOfx ( List accounts ) : void
accounts List
리턴 void
예제 #1
0
        /// <summary>
        /// OFXファイル書き出し
        /// </summary>
        /// <param name="accounts">アカウントリスト</param>
        public override void WriteFile(List<Account> accounts)
        {
            Ofx ofx = new Ofx();

            // OFX 要素を生成する
            ofx.genOfx(accounts);

            StreamWriter w = new StreamWriter(this.ofxFilePath, false); //, Encoding.UTF8);
            w.NewLine = "\n";

            // SGMLヘッダ出力
            w.WriteLine("OFXHEADER:100");
            w.WriteLine("DATA:OFXSGML");
            w.WriteLine("VERSION:102");
            w.WriteLine("SECURITY:NONE");
            w.WriteLine("ENCODING:UTF-8");
            w.WriteLine("CHARSET:CSUNICODE");
            w.WriteLine("COMPRESSION:NONE");
            w.WriteLine("OLDFILEUID:NONE");
            w.WriteLine("NEWFILEUID:NONE");
            w.WriteLine("");

            // OFX 要素出力
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            XmlTextWriter xw = new XmlTextWriter(sw);
            xw.Formatting = Formatting.Indented;

            ofx.doc.WriteTo(xw);
            w.Write(sb);

            xw.Close();
            sw.Close();
            w.Close();
        }
예제 #2
0
        /// <summary>
        /// OFX V2 ファイルを生成する
        /// </summary>
        /// <param name="accounts">アカウント</param>
        public override void WriteFile(List<Account> accounts)
        {
            Ofx ofx = new Ofx();

            XmlDeclaration decl = ofx.doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
            ofx.doc.AppendChild(decl);

            // OFX 宣言
            XmlProcessingInstruction pi = ofx.doc.CreateProcessingInstruction("OFX",
                "OFXHEADER=\"200\" VERSION=\"200\" SECURITY=\"NONE\" OLDFILEUID=\"NONE\" NEWFILEUID=\"NONE\"");
            ofx.doc.AppendChild(pi);

            ofx.genOfx(accounts);

            ofx.doc.Save(this.ofxFilePath);
        }
예제 #3
0
        /// <summary>
        /// OFX V2 ファイルを生成する
        /// </summary>
        /// <param name="accounts">アカウント</param>
        public override void WriteFile(List <Account> accounts)
        {
            Ofx ofx = new Ofx();

            XmlDeclaration decl = ofx.doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");

            ofx.doc.AppendChild(decl);

            // OFX 宣言
            XmlProcessingInstruction pi = ofx.doc.CreateProcessingInstruction("OFX",
                                                                              "OFXHEADER=\"200\" VERSION=\"200\" SECURITY=\"NONE\" OLDFILEUID=\"NONE\" NEWFILEUID=\"NONE\"");

            ofx.doc.AppendChild(pi);

            ofx.genOfx(accounts);

            ofx.doc.Save(this.ofxFilePath);
        }
예제 #4
0
        /// <summary>
        /// OFXファイル書き出し
        /// </summary>
        /// <param name="accounts">アカウントリスト</param>
        public override void WriteFile(List <Account> accounts)
        {
            Ofx ofx = new Ofx();

            // OFX 要素を生成する
            ofx.genOfx(accounts);

            StreamWriter w = new StreamWriter(this.ofxFilePath, false); //, Encoding.UTF8);

            w.NewLine = "\n";

            // SGMLヘッダ出力
            w.WriteLine("OFXHEADER:100");
            w.WriteLine("DATA:OFXSGML");
            w.WriteLine("VERSION:102");
            w.WriteLine("SECURITY:NONE");
            w.WriteLine("ENCODING:UTF-8");
            w.WriteLine("CHARSET:CSUNICODE");
            w.WriteLine("COMPRESSION:NONE");
            w.WriteLine("OLDFILEUID:NONE");
            w.WriteLine("NEWFILEUID:NONE");
            w.WriteLine("");

            // OFX 要素出力
            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);
            XmlTextWriter xw = new XmlTextWriter(sw);

            xw.Formatting = Formatting.Indented;

            ofx.doc.WriteTo(xw);
            w.Write(sb);

            xw.Close();
            sw.Close();
            w.Close();
        }