/// <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(); }
/// <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); }
/// <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); }
/// <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(); }
public void setUp() { ofx = new Ofx(); accounts = new List<Account>(); T1 = new Transaction(); T1.date = new DateTime(2000, 1, 1); T1.desc = "T1"; T1.type = TransType.Payment; T1.value = 1000; T1.balance = 10000; T2 = new Transaction(); T2.date = new DateTime(2010, 12, 31); T2.desc = "T2"; T2.type = TransType.Payment; T2.value = 2000; T2.balance = 12000; }