• R/O
  • SSH
  • HTTPS

moneyimport: Commit


Commit MetaInfo

Revision109 (tree)
Time2008-03-09 15:14:50
Authortmurakam

Log Message

ver 2.2

Change Summary

Incremental Difference

--- tags/FeliCa2Money-2.2/FeliCa2Money.html (nonexistent)
+++ tags/FeliCa2Money-2.2/FeliCa2Money.html (revision 109)
@@ -0,0 +1,238 @@
1+<html>
2+<head>
3+<title>FeliCa2Money</title>
4+<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
5+<style type="text/css">
6+<!--
7+a
8+{
9+ text-decoration:none;
10+}
11+a:link
12+{
13+ /*color: rgb(51,153,255);*/
14+ text-decoration:none;
15+}
16+a:hover
17+{
18+ color:red;
19+ text-decoration:underline;
20+}
21+a:visited
22+{
23+ color: rgb(51,102,204);
24+}
25+
26+a:active
27+{
28+ color: rgb(255,153,0);
29+}
30+
31+table
32+{
33+ table-border-color-light: rgb(255,204,102);
34+ table-border-color-dark: rgb(204,153,102);
35+}
36+
37+body, th, td {
38+ font-size: 100%;
39+}
40+
41+pre {
42+ font-size: 80%;
43+}
44+
45+body
46+{
47+ /*font-family: Verdana, Arial, Helvetica;*/
48+ /*background-color: rgb(255,255,204);*/
49+ /*background-color: rgb(255,255,210);*/
50+ /*color: rgb(102,102,51);*/
51+ color: black;
52+}
53+
54+h1
55+{
56+ font-size: 230%;
57+ color: #A000A0;
58+ background-color: #ececec;
59+ border-left: 10px solid #000080;
60+ border-top: 2px solid #000080;
61+ padding-left: 10; padding-top: 3; padding-bottom: 3;
62+}
63+h2
64+{
65+ font-size: 160%;
66+ color: #408080;
67+ background-color: #ececec;
68+ border-left: 6px solid #000080;
69+ border-top: 2px solid #000080;
70+ padding-left: 10; padding-top: 3; padding-bottom: 3;
71+}
72+h3
73+{
74+ font-size: 110%;
75+ color: #008000;
76+ background-color: #ececec;
77+ border-left: 5px solid #006000;
78+ /*border-top: 1px solid #006000;*/
79+ padding-left: 10; padding-top: 2; padding-bottom: 2;
80+}
81+h4
82+{
83+ color: rgb(153,153,0);
84+}
85+h5
86+{
87+ color: rgb(255,153,0);
88+}
89+h6
90+{
91+ color: rgb(51,102,204);
92+}
93+-->
94+</style>
95+</head>
96+<body>
97+<h1>FeliCa2Money ver 2.2マニュアル</h1>
98+
99+<h2>はじめに</h2>
100+
101+FeliCa2Moneyは、PaSoRi を使って Edy などの電子マネーの履歴を読み取り、
102+Microsoft Money の電子明細(OFX形式ファイル)に変換するものです。
103+FeliCa2Money を使えば、ワンタッチで家計簿の記帳を行えます。
104+
105+<p>
106+現バージョンでは、以下の電子マネーに対応しています。
107+
108+<ul>
109+<li>Edy
110+<li>Suica
111+<li>ICOCA
112+<li>PiTaPa
113+<li>PASMO
114+<li>nanaco
115+<li>TOICA
116+</ul>
117+
118+<i>ただし、作者がテストしているのは Edy / Suica / nanacoだけです</i>
119+<p>
120+
121+<h2>必要環境</h2>
122+
123+<ul>
124+<li>USB ポートを備えた Windows PC : たぶん Windows Vista, XP, 2000 あたりなら問題なく動作します
125+<li><b>.NET Framework 2.0 以降</b>
126+<li>SONY 非接触 IC カードリーダー/ライター (PaSoRi)
127+<li>PaSoRi 基本ソフトウェア
128+</ul>
129+
130+<b>注意: Version 2.0 から、.NET Framework が必要になりました。</b> Windows Update などを
131+利用してインストールしておいてください。
132+<p>
133+
134+また、ver 2.2 からは SFCPeep は不要となりました。
135+
136+<h2>使用方法</h2>
137+
138+最初に「設定」を押して設定を行っておいて下さい。
139+物販店舗検索優先エリアは自分が使用しているエリアに応じて設定を行って下さい。これを設定
140+しないと、誤った店舗名が出力される可能性が高くなります。
141+<p>
142+
143+電子マネーを PaSoRi に置き、Edy/Suica/Nanao のいずれかのボタンをクリックしてください。
144+カードが読み取られ、電子明細(OFXファイル)が生成されます。
145+<p>
146+「保存後に OFX ファイルを自動的に起動する」オプションをオンにしておくと、
147+自動的に Microsoft Money が立ち上がり、明細が取り込まれます。
148+
149+<h3>駅名データベースについて</h3>
150+
151+Suica などでは駅名/店舗名が自動的に入力されます。
152+駅名/店舗名のデータベースは、<a href="http://www014.upp.so-net.ne.jp/SFCardFan/">IC SFCard Fan</a> で
153+配布されているデータベース(2008/2/25版)を使用しています。
154+
155+<p>
156+データベースを最新のものに入れ替えるには、
157+<a href="http://www014.upp.so-net.ne.jp/SFCardFan/">IC SFCard Fan</a>の
158+「差し替え用駅名情報データベース」をダウンロードし、圧縮ファイルを展開してできる
159+StationCode.mdb を FeliCa2Money のインストールディレクトリにコピーしてください。
160+
161+<h2>アンインストール</h2>
162+
163+コントロールパネルの「プログラムの追加と削除」から削除してください。
164+<p>
165+
166+
167+<h2>制限事項</h2>
168+
169+<ul>
170+<li>Edy には使用履歴は最新6件までしか保存されていませんので、Money に取り込めるのも最新6件だけです。
171+<li>Suica には使用履歴が最新20件まで保存されていますが、FeliCa2Money で変換できるのは最新19件のみです。これは、Suica の各履歴には残高しか記録されておらず、取引額を前回残高との差分で計算するしかないためです。
172+</ul>
173+
174+<h2>ライセンス</h2>
175+
176+Copyright (C) 2001-2007 Takuya Murakami, All Rights Reserved.
177+<p>
178+
179+ライセンスは GPL に準じます。付属の <a href="LICENSE.TXT">LICENSE.TXT</a> を参照してください。
180+<p>
181+ソースコードは Subversion で取得できます。
182+URL は http://svn.sourceforge.jp/svnroot/moneyimport/trunk/ です。
183+<p>
184+プロジェクトホームページは <a href="http://sourceforge.jp/projects/moneyimport/">http://sourceforge.jp/projects/moneyimport/</a> にあります。
185+
186+<h2>謝辞</h2>
187+
188+駅名/店舗名データベースを提供下さっているでんのすけさん(IC SFCard Fan)に感謝します。
189+
190+<h2>改版履歴</h2>
191+
192+<pre>
193+2008-03-09 : ver 2.2
194+
195+ * SFCPeep を使用せず、felicalib のみで解析を行うようにした。
196+ * 物販店舗検索優先エリア指定オプションを追加
197+
198+2008-03-01 : ver 2.1
199+
200+ * Suica 未登録店舗において、連番ではなく出線区/出駅順を出力するようにした。
201+ (Money 自動補完を有効にするため)
202+
203+2008-02-03 : ver 2.0
204+
205+ * .NET Framework 対応 (C# 書き直し)
206+ * 金額が 0 の取引をスキップするオプション追加 (PiTaPa ポストペイなどの対応)
207+ * OFX ファイル保存先指定オプション追加
208+ * OFX ファイル自動起動オプション追加
209+
210+2007-11-06 : ver 1.2
211+
212+ * nanaco に対応。
213+
214+2007-08-22 : ver 1.1
215+
216+ * 支払先に利用店舗名が入っていない場合(Edy の "支払" およびSuica の "物販")、
217+ Money が誤って支払先を補完してしまうのを防止するため、連番を追記するようにした。
218+
219+2007-03-18 : ver β2: (PASMO開始当日 :-)
220+
221+ * セットアップを追加
222+ * OFX ファイルに MEMO (備考)フィールドを追加するようにした
223+
224+2007-03-17 : ver β1
225+
226+ * 初版 (PASMO開始前日 :-)
227+
228+</pre>
229+
230+<h2>作者連絡先</h2>
231+
232+<ul>
233+<li>村上 卓弥 : tmurakam@mtd.biglobe.ne.jp
234+<li>プロジェクトWebサイト: <a href="http://moneyimport.sourceforge.jp">http://moneyimport.sourceforge.jp</a>
235+</ul>
236+
237+</body>
238+</html>
--- tags/FeliCa2Money-2.2/ChangeLog (nonexistent)
+++ tags/FeliCa2Money-2.2/ChangeLog (revision 109)
@@ -0,0 +1,42 @@
1+2008-03-09 : Takuya Murakami
2+ * ver 2.2
3+ * SFCPeep を使用せず、felicalib のみを使うように変更
4+ * Suica 解析処理を felicalib で行うようにした
5+ * StationCode.mdb 検索処理を追加
6+ * 物販店舗検索優先エリアオプションを追加
7+
8+2008-03-08 : Takuya Murakami
9+ * nanaco ポイント交換に対応(したつもり)
10+
11+2008-03-06 : Takuya Murakami
12+ * Edy 読み取りに SFCPeep ではなく felicalib を使うようにした。
13+
14+2008-03-01 : Takuya Murakami
15+ * ver 2.1
16+ * Suica 未登録店舗において、連番ではなく出線区/出駅順を出力するようにした。
17+ (Money 自動補完を有効にするため)
18+
19+2008-02-03 : Takuya Murakami
20+ * ver 2.0
21+ * .NET Framework 対応 (C# 書き直し)
22+ * 金額が 0 の取引をスキップするオプション追加 (PiTaPa ポストペイなどの対応)
23+ * OFX ファイル保存先指定オプション追加
24+ * OFX ファイル自動起動オプション追加
25+
26+2007-11-06 : Takuya Murakami
27+ * ver 1.2
28+ * nanaco に対応。
29+
30+2007-08-22 : Takuya Murakami
31+ * ver 1.1
32+ * 支払先に利用店舗名が入っていない場合(Edy の "支払" およびSuica の "物販")、
33+ Money が誤って支払先を補完してしまうのを防止するため、連番を追記するようにした。
34+
35+2007-03-18 : Takuya Murakami
36+ * ver β2: (PASMO開始当日 :-)
37+ * セットアップを追加
38+ * OFX ファイルに MEMO (備考)フィールドを追加するようにした
39+
40+2007-03-17 : Takuya Murakami
41+ * ver β1
42+ * 初版 (PASMO開始前日 :-)
--- tags/FeliCa2Money-2.2/Properties/Settings.Designer.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Properties/Settings.Designer.cs (revision 109)
@@ -0,0 +1,84 @@
1+//------------------------------------------------------------------------------
2+// <auto-generated>
3+// このコードはツールによって生成されました。
4+// ランタイム バージョン:2.0.50727.1434
5+//
6+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
7+// コードが再生成されるときに損失したりします。
8+// </auto-generated>
9+//------------------------------------------------------------------------------
10+
11+namespace FeliCa2Money.Properties {
12+
13+
14+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
16+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17+
18+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19+
20+ public static Settings Default {
21+ get {
22+ return defaultInstance;
23+ }
24+ }
25+
26+ [global::System.Configuration.UserScopedSettingAttribute()]
27+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
29+ public bool IgnoreZeroTransaction {
30+ get {
31+ return ((bool)(this["IgnoreZeroTransaction"]));
32+ }
33+ set {
34+ this["IgnoreZeroTransaction"] = value;
35+ }
36+ }
37+
38+ [global::System.Configuration.UserScopedSettingAttribute()]
39+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
41+ public bool ManualOfxPath {
42+ get {
43+ return ((bool)(this["ManualOfxPath"]));
44+ }
45+ set {
46+ this["ManualOfxPath"] = value;
47+ }
48+ }
49+
50+ [global::System.Configuration.UserScopedSettingAttribute()]
51+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
53+ public bool AutoKickOfxFile {
54+ get {
55+ return ((bool)(this["AutoKickOfxFile"]));
56+ }
57+ set {
58+ this["AutoKickOfxFile"] = value;
59+ }
60+ }
61+
62+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
63+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64+ [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
65+ [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\StationCode.mdb")]
66+ public string StationCodeConnectionString {
67+ get {
68+ return ((string)(this["StationCodeConnectionString"]));
69+ }
70+ }
71+
72+ [global::System.Configuration.UserScopedSettingAttribute()]
73+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
74+ [global::System.Configuration.DefaultSettingValueAttribute("1")]
75+ public int ShopAreaPriority {
76+ get {
77+ return ((int)(this["ShopAreaPriority"]));
78+ }
79+ set {
80+ this["ShopAreaPriority"] = value;
81+ }
82+ }
83+ }
84+}
--- tags/FeliCa2Money-2.2/Properties/AssemblyInfo.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Properties/AssemblyInfo.cs (revision 109)
@@ -0,0 +1,33 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+using System.Runtime.InteropServices;
4+
5+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+// アセンブリに関連付けられている情報を変更するには、
7+// これらの属性値を変更してください。
8+[assembly: AssemblyTitle("FeliCa2Money")]
9+[assembly: AssemblyDescription("FeliCa から電子明細を読み取り Money にインポート")]
10+[assembly: AssemblyConfiguration("")]
11+[assembly: AssemblyCompany("Takuya Murakami")]
12+[assembly: AssemblyProduct("FeliCa2Money")]
13+[assembly: AssemblyCopyright("Copyright (C) 2001-2008, Takuya Murakami")]
14+[assembly: AssemblyTrademark("")]
15+[assembly: AssemblyCulture("")]
16+
17+// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントには
18+// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
19+// その型の ComVisible 属性を true に設定してください。
20+[assembly: ComVisible(false)]
21+
22+// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
23+[assembly: Guid("9bed26f0-b693-4733-95a3-2839a1fb85d2")]
24+
25+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
26+//
27+// Major Version
28+// Minor Version
29+// Build Number
30+// Revision
31+//
32+[assembly: AssemblyVersion("2.2.0.0")]
33+[assembly: AssemblyFileVersion("2.2.0.0")]
--- tags/FeliCa2Money-2.2/Properties/Resources.Designer.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Properties/Resources.Designer.cs (revision 109)
@@ -0,0 +1,91 @@
1+//------------------------------------------------------------------------------
2+// <auto-generated>
3+// このコードはツールによって生成されました。
4+// ランタイム バージョン:2.0.50727.1378
5+//
6+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
7+// コードが再生成されるときに損失したりします。
8+// </auto-generated>
9+//------------------------------------------------------------------------------
10+
11+namespace FeliCa2Money.Properties {
12+ using System;
13+
14+
15+ /// <summary>
16+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
17+ /// </summary>
18+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
19+ // または Visual Studio のようなツールを使用して自動生成されました。
20+ // メンバを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
21+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
22+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
23+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25+ internal class Resources {
26+
27+ private static global::System.Resources.ResourceManager resourceMan;
28+
29+ private static global::System.Globalization.CultureInfo resourceCulture;
30+
31+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32+ internal Resources() {
33+ }
34+
35+ /// <summary>
36+ /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
37+ /// </summary>
38+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39+ internal static global::System.Resources.ResourceManager ResourceManager {
40+ get {
41+ if (object.ReferenceEquals(resourceMan, null)) {
42+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FeliCa2Money.Properties.Resources", typeof(Resources).Assembly);
43+ resourceMan = temp;
44+ }
45+ return resourceMan;
46+ }
47+ }
48+
49+ /// <summary>
50+ /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
51+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
52+ /// </summary>
53+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54+ internal static global::System.Globalization.CultureInfo Culture {
55+ get {
56+ return resourceCulture;
57+ }
58+ set {
59+ resourceCulture = value;
60+ }
61+ }
62+
63+ internal static System.Drawing.Bitmap Edy {
64+ get {
65+ object obj = ResourceManager.GetObject("Edy", resourceCulture);
66+ return ((System.Drawing.Bitmap)(obj));
67+ }
68+ }
69+
70+ internal static System.Drawing.Icon Felica2Money {
71+ get {
72+ object obj = ResourceManager.GetObject("Felica2Money", resourceCulture);
73+ return ((System.Drawing.Icon)(obj));
74+ }
75+ }
76+
77+ internal static System.Drawing.Bitmap Nanaco {
78+ get {
79+ object obj = ResourceManager.GetObject("Nanaco", resourceCulture);
80+ return ((System.Drawing.Bitmap)(obj));
81+ }
82+ }
83+
84+ internal static System.Drawing.Bitmap Suica {
85+ get {
86+ object obj = ResourceManager.GetObject("Suica", resourceCulture);
87+ return ((System.Drawing.Bitmap)(obj));
88+ }
89+ }
90+ }
91+}
--- tags/FeliCa2Money-2.2/Properties/app.manifest (nonexistent)
+++ tags/FeliCa2Money-2.2/Properties/app.manifest (revision 109)
@@ -0,0 +1,11 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
4+ <security>
5+ <applicationRequestMinimum>
6+ <defaultAssemblyRequest permissionSetReference="Custom" />
7+ <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
8+ </applicationRequestMinimum>
9+ </security>
10+ </trustInfo>
11+</asmv1:assembly>
\ No newline at end of file
--- tags/FeliCa2Money-2.2/OptionDialog.Designer.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/OptionDialog.Designer.cs (revision 109)
@@ -0,0 +1,191 @@
1+namespace FeliCa2Money
2+{
3+ partial class OptionDialog
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.checkIgnoreZeroTransaction = new System.Windows.Forms.CheckBox();
32+ this.checkManualOfxPath = new System.Windows.Forms.CheckBox();
33+ this.checkAutoKickOfxFile = new System.Windows.Forms.CheckBox();
34+ this.buttonOK = new System.Windows.Forms.Button();
35+ this.buttonCancel = new System.Windows.Forms.Button();
36+ this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
37+ this.radioSuica = new System.Windows.Forms.RadioButton();
38+ this.radioIcoca = new System.Windows.Forms.RadioButton();
39+ this.radioIruca = new System.Windows.Forms.RadioButton();
40+ this.groupBox1 = new System.Windows.Forms.GroupBox();
41+ this.label2 = new System.Windows.Forms.Label();
42+ this.groupBox1.SuspendLayout();
43+ this.SuspendLayout();
44+ //
45+ // checkIgnoreZeroTransaction
46+ //
47+ this.checkIgnoreZeroTransaction.AutoSize = true;
48+ this.checkIgnoreZeroTransaction.Location = new System.Drawing.Point(24, 94);
49+ this.checkIgnoreZeroTransaction.Name = "checkIgnoreZeroTransaction";
50+ this.checkIgnoreZeroTransaction.Size = new System.Drawing.Size(158, 16);
51+ this.checkIgnoreZeroTransaction.TabIndex = 1;
52+ this.checkIgnoreZeroTransaction.Text = "金額が 0 の取引を無視する";
53+ this.checkIgnoreZeroTransaction.UseVisualStyleBackColor = true;
54+ //
55+ // checkManualOfxPath
56+ //
57+ this.checkManualOfxPath.AutoSize = true;
58+ this.checkManualOfxPath.Location = new System.Drawing.Point(24, 116);
59+ this.checkManualOfxPath.Name = "checkManualOfxPath";
60+ this.checkManualOfxPath.Size = new System.Drawing.Size(178, 16);
61+ this.checkManualOfxPath.TabIndex = 2;
62+ this.checkManualOfxPath.Text = "OFXファイル名を手動で指定する";
63+ this.checkManualOfxPath.UseVisualStyleBackColor = true;
64+ //
65+ // checkAutoKickOfxFile
66+ //
67+ this.checkAutoKickOfxFile.AutoSize = true;
68+ this.checkAutoKickOfxFile.Location = new System.Drawing.Point(24, 138);
69+ this.checkAutoKickOfxFile.Name = "checkAutoKickOfxFile";
70+ this.checkAutoKickOfxFile.Size = new System.Drawing.Size(222, 16);
71+ this.checkAutoKickOfxFile.TabIndex = 3;
72+ this.checkAutoKickOfxFile.Text = "保存後にOFXファイルを自動的に起動する";
73+ this.checkAutoKickOfxFile.UseVisualStyleBackColor = true;
74+ //
75+ // buttonOK
76+ //
77+ this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
78+ this.buttonOK.Location = new System.Drawing.Point(267, 161);
79+ this.buttonOK.Name = "buttonOK";
80+ this.buttonOK.Size = new System.Drawing.Size(75, 23);
81+ this.buttonOK.TabIndex = 6;
82+ this.buttonOK.Text = "OK";
83+ this.buttonOK.UseVisualStyleBackColor = true;
84+ //
85+ // buttonCancel
86+ //
87+ this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
88+ this.buttonCancel.Location = new System.Drawing.Point(357, 161);
89+ this.buttonCancel.Name = "buttonCancel";
90+ this.buttonCancel.Size = new System.Drawing.Size(75, 23);
91+ this.buttonCancel.TabIndex = 7;
92+ this.buttonCancel.Text = "キャンセル";
93+ this.buttonCancel.UseVisualStyleBackColor = true;
94+ //
95+ // openFileDialog
96+ //
97+ this.openFileDialog.FileName = "openFileDialog1";
98+ this.openFileDialog.Filter = "SFCPeep|SFCPeep.exe";
99+ this.openFileDialog.RestoreDirectory = true;
100+ //
101+ // radioSuica
102+ //
103+ this.radioSuica.AutoSize = true;
104+ this.radioSuica.Checked = true;
105+ this.radioSuica.Location = new System.Drawing.Point(16, 18);
106+ this.radioSuica.Name = "radioSuica";
107+ this.radioSuica.Size = new System.Drawing.Size(96, 16);
108+ this.radioSuica.TabIndex = 1;
109+ this.radioSuica.TabStop = true;
110+ this.radioSuica.Text = "Suica/PASMO";
111+ this.radioSuica.UseVisualStyleBackColor = true;
112+ //
113+ // radioIcoca
114+ //
115+ this.radioIcoca.AutoSize = true;
116+ this.radioIcoca.Location = new System.Drawing.Point(134, 18);
117+ this.radioIcoca.Name = "radioIcoca";
118+ this.radioIcoca.Size = new System.Drawing.Size(58, 16);
119+ this.radioIcoca.TabIndex = 1;
120+ this.radioIcoca.Text = "ICOCA";
121+ this.radioIcoca.UseVisualStyleBackColor = true;
122+ //
123+ // radioIruca
124+ //
125+ this.radioIruca.AutoSize = true;
126+ this.radioIruca.Location = new System.Drawing.Point(231, 18);
127+ this.radioIruca.Name = "radioIruca";
128+ this.radioIruca.Size = new System.Drawing.Size(50, 16);
129+ this.radioIruca.TabIndex = 2;
130+ this.radioIruca.Text = "IruCa";
131+ this.radioIruca.UseVisualStyleBackColor = true;
132+ //
133+ // groupBox1
134+ //
135+ this.groupBox1.Controls.Add(this.label2);
136+ this.groupBox1.Controls.Add(this.radioSuica);
137+ this.groupBox1.Controls.Add(this.radioIruca);
138+ this.groupBox1.Controls.Add(this.radioIcoca);
139+ this.groupBox1.Location = new System.Drawing.Point(10, 12);
140+ this.groupBox1.Name = "groupBox1";
141+ this.groupBox1.Size = new System.Drawing.Size(410, 62);
142+ this.groupBox1.TabIndex = 0;
143+ this.groupBox1.TabStop = false;
144+ this.groupBox1.Text = "物販店舗検索優先エリア";
145+ //
146+ // label2
147+ //
148+ this.label2.AutoSize = true;
149+ this.label2.Location = new System.Drawing.Point(30, 43);
150+ this.label2.Name = "label2";
151+ this.label2.Size = new System.Drawing.Size(265, 12);
152+ this.label2.TabIndex = 11;
153+ this.label2.Text = "※店舗コード重複時に優先するエリアを指定してください";
154+ //
155+ // OptionDialog
156+ //
157+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
158+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
159+ this.ClientSize = new System.Drawing.Size(450, 198);
160+ this.Controls.Add(this.groupBox1);
161+ this.Controls.Add(this.buttonCancel);
162+ this.Controls.Add(this.buttonOK);
163+ this.Controls.Add(this.checkAutoKickOfxFile);
164+ this.Controls.Add(this.checkManualOfxPath);
165+ this.Controls.Add(this.checkIgnoreZeroTransaction);
166+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
167+ this.Name = "OptionDialog";
168+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
169+ this.Text = "オプション";
170+ this.groupBox1.ResumeLayout(false);
171+ this.groupBox1.PerformLayout();
172+ this.ResumeLayout(false);
173+ this.PerformLayout();
174+
175+ }
176+
177+ #endregion
178+
179+ private System.Windows.Forms.CheckBox checkIgnoreZeroTransaction;
180+ private System.Windows.Forms.CheckBox checkManualOfxPath;
181+ private System.Windows.Forms.CheckBox checkAutoKickOfxFile;
182+ private System.Windows.Forms.Button buttonOK;
183+ private System.Windows.Forms.Button buttonCancel;
184+ private System.Windows.Forms.OpenFileDialog openFileDialog;
185+ private System.Windows.Forms.RadioButton radioSuica;
186+ private System.Windows.Forms.RadioButton radioIcoca;
187+ private System.Windows.Forms.RadioButton radioIruca;
188+ private System.Windows.Forms.GroupBox groupBox1;
189+ private System.Windows.Forms.Label label2;
190+ }
191+}
\ No newline at end of file
--- tags/FeliCa2Money-2.2/OptionDialog.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/OptionDialog.cs (revision 109)
@@ -0,0 +1,72 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Text;
7+using System.Windows.Forms;
8+
9+namespace FeliCa2Money
10+{
11+ public partial class OptionDialog : Form
12+ {
13+ public OptionDialog()
14+ {
15+ InitializeComponent();
16+
17+ LoadProperties();
18+ }
19+
20+ public void LoadProperties()
21+ {
22+ Properties.Settings s = Properties.Settings.Default;
23+ s.Upgrade();
24+
25+ checkIgnoreZeroTransaction.Checked = s.IgnoreZeroTransaction;
26+ checkManualOfxPath.Checked = s.ManualOfxPath;
27+ checkAutoKickOfxFile.Checked = s.AutoKickOfxFile;
28+
29+ //textSfcPeepPath.Text = s.SFCPeepPath;
30+
31+ int p = s.ShopAreaPriority;
32+ switch (p)
33+ {
34+ default:
35+ case Suica.AreaSuica: radioSuica.Checked = true; break;
36+ case Suica.AreaIcoca: radioIcoca.Checked = true; break;
37+ case Suica.AreaIruca: radioIruca.Checked = true; break;
38+ }
39+ }
40+
41+ public void SaveProperties()
42+ {
43+ Properties.Settings s = Properties.Settings.Default;
44+
45+ s.IgnoreZeroTransaction = checkIgnoreZeroTransaction.Checked;
46+ s.ManualOfxPath = checkManualOfxPath.Checked;
47+ s.AutoKickOfxFile = checkAutoKickOfxFile.Checked;
48+ //s.SFCPeepPath = textSfcPeepPath.Text;
49+
50+ int p = Suica.AreaSuica;
51+ if (radioSuica.Checked) p = Suica.AreaSuica;
52+ else if (radioIcoca.Checked) p = Suica.AreaIcoca;
53+ else if (radioIruca.Checked) p = Suica.AreaIruca;
54+ s.ShopAreaPriority = p;
55+
56+ s.Save();
57+ }
58+
59+ /*
60+ private void buttonSfcPath_Click(object sender, EventArgs e)
61+ {
62+ openFileDialog.FileName = textSfcPeepPath.Text;
63+ openFileDialog.InitialDirectory = System.IO.Path.GetDirectoryName(textSfcPeepPath.Text);
64+
65+ if (openFileDialog.ShowDialog() == DialogResult.OK)
66+ {
67+ textSfcPeepPath.Text = openFileDialog.FileName;
68+ }
69+ }
70+ */
71+ }
72+}
--- tags/FeliCa2Money-2.2/Suica.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Suica.cs (revision 109)
@@ -0,0 +1,291 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+// Suica/PASMO/ICOCA/PiTaPa/Toica など交通系カード処理
22+
23+using System;
24+using System.Collections.Generic;
25+using System.Text;
26+using FelicaLib;
27+
28+namespace FeliCa2Money
29+{
30+ class Suica : CardWithFelicaLib
31+ {
32+ // 物販エリアコード
33+ public const int AreaSuica = 1;
34+ public const int AreaIcoca = 2;
35+ public const int AreaIruca = 4;
36+
37+ private StationCode stCode;
38+
39+ public Suica()
40+ {
41+ ident = "Suica";
42+ cardName = "Suica";
43+
44+ systemCode = (int)SystemCode.Suica;
45+ serviceCode = 0x090f; // 履歴エリアのサービスコード
46+ needReverse = true;
47+
48+ stCode = new StationCode();
49+ }
50+
51+ public override void Dispose()
52+ {
53+ base.Dispose();
54+ stCode.Dispose();
55+ }
56+
57+ // カード ID を取得
58+ // Suica では IDm を用いる
59+ public override void analyzeCardId(Felica f)
60+ {
61+ byte[] data = f.IDm();
62+ if (data == null)
63+ {
64+ throw new Exception("IDm を読み取れません");
65+ }
66+
67+ cardId = "";
68+ for (int i = 0; i < 8; i++) {
69+ cardId += data[i].ToString("X2");
70+ }
71+ }
72+
73+ // 後処理
74+ // Suica の場合、履歴には残高しか記録されていない。
75+ // ここでは、残高の差額から各トランザクションの金額を計算する
76+ // (このため、最も古いエントリは金額を計算できない)
77+ protected override void PostProcess(List<Transaction> list)
78+ {
79+ int prevBalance = 0;
80+
81+ foreach (Transaction t in list)
82+ {
83+ t.value = t.balance - prevBalance;
84+ prevBalance = t.balance;
85+ }
86+ list.RemoveAt(0); // 最古のエントリは捨てる
87+ }
88+
89+ // トランザクション解析
90+ public override bool analyzeTransaction(Transaction t, byte[] data)
91+ {
92+ int ctype = data[0]; // 端末種
93+ int proc = data[1]; // 処理
94+ int date = (data[4] << 8) | data[5]; // 日付
95+ int balance = (data[11] << 8) | data[10]; // 残高(little endian)
96+ int seq = (data[12] << 16) | (data[13] << 8) | data[14]; // 連番
97+ int region = data[15]; // リージョン
98+
99+ // 処理
100+ t.desc = procType(proc);
101+
102+ // 残高
103+ t.balance = balance;
104+
105+ // 金額は PostProcess で計算する
106+ t.value = 0;
107+
108+ // 日付
109+ int yy = (date >> 9) + 2000;
110+ int mm = (date >> 5) & 0xf;
111+ int dd = date & 0x1f;
112+ t.date = new DateTime(yy, mm, dd, 0, 0, 0);
113+
114+ // ID
115+ t.id = seq;
116+
117+ // 駅名/店舗名などを調べる
118+ int in_line = -1;
119+ int in_sta = -1;
120+ int out_line, out_sta;
121+ string[] in_name = null, out_name = null;
122+ int area;
123+
124+ switch (ctype)
125+ {
126+ case CT_SHOP:
127+ case CT_VEND:
128+ // 物販/自販機
129+ area = Properties.Settings.Default.ShopAreaPriority;
130+
131+ //time = (data[6] << 8) | data[7];
132+ out_line = data[8];
133+ out_sta = data[9];
134+
135+ // 優先エリアで検索
136+ out_name = stCode.getShopName(area, ctype, out_line, out_sta);
137+ if (out_name == null)
138+ {
139+ // 全エリアで検索
140+ out_name = stCode.getShopName(-1, ctype, out_line, out_sta);
141+ }
142+ break;
143+
144+ case CT_CAR:
145+ // 車載端末(バス)
146+ out_line = (data[6] << 8) | data[7];
147+ out_sta = (data[8] << 8) | data[9];
148+ out_name = stCode.getBusName(out_line, out_sta);
149+ break;
150+
151+ default:
152+ // それ以外(運賃、チャージなど)
153+ in_line = data[6];
154+ in_sta = data[7];
155+ out_line = data[8];
156+ out_sta = data[9];
157+ if (in_line == 0 && in_sta == 0 && out_line == 0 && out_sta == 0)
158+ {
159+ break;
160+ }
161+
162+ // エリアを求める
163+ if (region >= 1) {
164+ area = 2; // 関西公営・私鉄
165+ }
166+ else if (in_line >= 0x80)
167+ {
168+ area = 1; // 関東公営・私鉄
169+ }
170+ else
171+ {
172+ area = 0; // JR
173+ }
174+
175+ in_name = stCode.getStationName(area, in_line, in_sta);
176+ out_name = stCode.getStationName(area, out_line, out_sta);
177+ break;
178+ }
179+
180+ // 備考の先頭には端末種を入れる
181+ t.memo = consoleType(ctype);
182+
183+ switch (ctype)
184+ {
185+ case CT_SHOP:
186+ case CT_VEND:
187+ if (out_name != null)
188+ {
189+ // 適用に店舗名を入れる
190+ t.desc += " " + out_name[0] + " " + out_name[1];
191+ }
192+ else
193+ {
194+ // 店舗名が不明の場合、適用には出線区/出駅順コードをそのまま付与する。
195+ // こうしないと Money が過去の履歴から誤って店舗名を補完してしまい
196+ // 都合がわるいため
197+ t.desc += " 店舗コード:" + out_line.ToString("X02") + out_sta.ToString("X02");
198+ }
199+ break;
200+
201+ case CT_CAR:
202+ if (out_name != null)
203+ {
204+ // 適用にバス会社名、備考に停留所名を入れる
205+ t.desc += " " + out_name[0];
206+ t.memo += " " + out_name[1];
207+ }
208+ break;
209+
210+ default:
211+ if (in_line == 0 && in_sta == 0 & out_line == 0 && out_sta == 0)
212+ {
213+ // チャージなどの場合は、何も追加しない
214+ break;
215+ }
216+
217+ // 適用に入会社または出会社を追加
218+ if (in_name != null)
219+ {
220+ t.desc += " " + in_name[0];
221+ }
222+ else if (out_name != null)
223+ {
224+ t.desc += " " + out_name[0];
225+ }
226+
227+ // 備考に入出会社/駅名を記載
228+ if (in_name != null) {
229+ t.memo += " " + in_name[0] + "(" + in_name[1] + ")";
230+ } else {
231+ t.memo += " 未登録";
232+ }
233+ t.memo += " - ";
234+
235+ if (out_name != null) {
236+ t.memo += out_name[0] + "(" + out_name[1] + ")";
237+ } else {
238+ t.memo += "未登録";
239+ }
240+ break;
241+ }
242+
243+ return true;
244+ }
245+
246+ private const int CT_SHOP = 0xc7; // 物販端末
247+ private const int CT_VEND = 0xc8; // 自販機
248+ private const int CT_CAR = 0x05; // 車載端末(バス)
249+
250+ // 端末種文字列を返す
251+ private string consoleType(int ctype)
252+ {
253+ switch (ctype) {
254+ case CT_SHOP: return "物販端末";
255+ case CT_VEND: return "自販機";
256+ case CT_CAR: return "車載端末";
257+ case 0x03: return "清算機";
258+ case 0x08: return "券売機";
259+ case 0x12: return "券売機";
260+ case 0x16: return "改札機";
261+ case 0x17: return "簡易改札機";
262+ case 0x18: return "窓口端末";
263+ case 0x1a: return "改札端末";
264+ case 0x1b: return "携帯電話";
265+ case 0x1c: return "乗継清算機";
266+ case 0x1d: return "連絡改札機";
267+ }
268+ return "不明";
269+ }
270+
271+ // 処理種別文字列を返す
272+ private string procType(int proc)
273+ {
274+ switch (proc) {
275+ case 0x01: return "運賃";
276+ case 0x02: return "チャージ";
277+ case 0x03: return "券購";
278+ case 0x04: return "清算";
279+ case 0x07: return "新規";
280+ case 0x0d: return "バス";
281+ case 0x0f: return "バス";
282+ case 0x14: return "オートチャージ";
283+ case 0x46: return "物販";
284+ case 0x49: return "サンクスチャージ";
285+ case 0x4a: return "物販取消";
286+ case 0xc6: return "物販(現金併用)";
287+ }
288+ return "不明";
289+ }
290+ }
291+}
--- tags/FeliCa2Money-2.2/StationCode.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/StationCode.cs (revision 109)
@@ -0,0 +1,107 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+// stationcode.mdb アクセスクラス (試作中)
22+
23+using System;
24+using System.Data.OleDb;
25+
26+namespace FeliCa2Money
27+{
28+ class StationCode : IDisposable
29+ {
30+ private OleDbConnection conn;
31+
32+ public StationCode()
33+ {
34+ conn = new System.Data.OleDb.OleDbConnection();
35+ conn.ConnectionString = Properties.Settings.Default.StationCodeConnectionString;
36+ conn.Open();
37+ }
38+
39+ public void Dispose()
40+ {
41+ conn.Close();
42+ }
43+
44+ private string[] doQuery(string sql)
45+ {
46+ OleDbCommand cmd;
47+ OleDbDataReader dr;
48+
49+ cmd = new OleDbCommand(sql, conn);
50+ dr = cmd.ExecuteReader();
51+
52+ string[] result = null;
53+ if (dr.Read())
54+ {
55+ result = new string[2];
56+ if (dr.IsDBNull(0))
57+ {
58+ result[0] = "";
59+ }
60+ else
61+ {
62+ result[0] = dr.GetString(0);
63+ }
64+
65+ if (dr.IsDBNull(1))
66+ {
67+ result[1] = "";
68+ }
69+ else
70+ {
71+ result[1] = dr.GetString(1);
72+ }
73+ }
74+ dr.Close();
75+ return result;
76+ }
77+
78+ // 駅名を検索する
79+ public string[] getStationName(int area, int line, int station)
80+ {
81+ string sql = string.Format("SELECT CompanyName,StationName FROM StationCode WHERE"
82+ + " AreaCode={0} AND LineCode={1} AND StationCode={2}", area, line, station);
83+ return doQuery(sql);
84+ }
85+
86+ // 店舗名を検索する
87+ // area = -1 として検索すると、area 指定なしとみなす
88+ public string[] getShopName(int area, int terminal, int line, int station)
89+ {
90+ string sql = string.Format("SELECT CompanyName,ShopName FROM ShopCode WHERE"
91+ + " TerminalCode={0} AND LineCode={1} AND StationCode={2}", terminal, line, station);
92+ if (area >= 0)
93+ {
94+ sql += " AND AreaCode=" + area.ToString();
95+ }
96+ return doQuery(sql);
97+ }
98+
99+ // バス停留所名を検索する
100+ public string[] getBusName(int line, int station)
101+ {
102+ string sql = string.Format("SELECT BusCompanyName,BusStationName FROM BusCode WHERE"
103+ + " BusLineCode={0} AND BusStationCode={1}", line, station);
104+ return doQuery(sql);
105+ }
106+ }
107+}
--- tags/FeliCa2Money-2.2/Edy.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Edy.cs (revision 109)
@@ -0,0 +1,103 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using FelicaLib;
25+
26+namespace FeliCa2Money
27+{
28+ class Edy : CardWithFelicaLib
29+ {
30+ public Edy()
31+ {
32+ ident = "Edy";
33+ cardName = "Edy";
34+
35+ systemCode = (int)SystemCode.Edy;
36+ serviceCode = 0x170f;
37+ needReverse = true;
38+ }
39+
40+ public override void analyzeCardId(Felica f)
41+ {
42+ byte[] data = f.ReadWithoutEncryption(0x110b, 0);
43+ if (data == null)
44+ {
45+ throw new Exception("Edy番号を読み取れません");
46+ }
47+
48+ cardId = "";
49+ for (int i = 2; i < 10; i++) {
50+ cardId += data[i].ToString("X2");
51+ }
52+ }
53+
54+ public override bool analyzeTransaction(Transaction t, byte[] data)
55+ {
56+ // 日付
57+ int value = (data[4] << 24) + (data[5] << 16) + (data[6] << 8) + data[7];
58+
59+ t.date = new DateTime(2000, 1, 1);
60+
61+ t.date += TimeSpan.FromDays(value >> 17);
62+ t.date += TimeSpan.FromSeconds(value & 0x1fff);
63+
64+ // 金額
65+ t.value = (data[8] << 24) + (data[9] << 16) + (data[10] << 8) + data[11];
66+
67+ // 残高
68+ t.balance = (data[12] << 24) + (data[13] << 16) + (data[14] << 8) + data[15];
69+
70+ // 連番
71+ t.id = (data[1] << 16) + (data[2] << 8) + data[3];
72+
73+ // 種別
74+ switch (data[0])
75+ {
76+ case 0x20:
77+ default:
78+ t.type = TransType.Debit; // 支払い
79+ t.desc = "支払";
80+ t.value = - t.value;
81+
82+ // 適用が"支払" だけだと、Money が過去の履歴から店舗名を勝手に
83+ // 補完してしまうので、連番を追加しておく。
84+ t.desc += " ";
85+ t.desc += t.id.ToString();
86+ break;
87+
88+ case 0x02:
89+ t.type = TransType.DirectDep;
90+ t.desc = "Edyチャージ";
91+ break;
92+
93+ case 0x04:
94+ t.type = TransType.DirectDep;
95+ t.desc = "Edyギフト";
96+ break;
97+ }
98+ t.memo = "";
99+
100+ return true;
101+ }
102+ }
103+}
--- tags/FeliCa2Money-2.2/Nanaco.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Nanaco.cs (revision 109)
@@ -0,0 +1,101 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using FelicaLib;
25+
26+namespace FeliCa2Money
27+{
28+ class Nanaco : CardWithFelicaLib
29+ {
30+ public Nanaco()
31+ {
32+ ident = "Nanaco";
33+ cardName = "Nanaco";
34+
35+ systemCode = (int)SystemCode.Common;
36+ serviceCode = 0x564f;
37+ needReverse = true;
38+ }
39+
40+ public override void analyzeCardId(Felica f)
41+ {
42+ byte[] data = f.ReadWithoutEncryption(0x558b, 0);
43+ if (data == null)
44+ {
45+ throw new Exception("nanaco番号を読み取れません");
46+ }
47+
48+ cardId = "";
49+ for (int i = 0; i < 8; i++) {
50+ cardId += data[i].ToString("X2");
51+ }
52+ }
53+
54+ public override bool analyzeTransaction(Transaction t, byte[] data)
55+ {
56+ // 日付
57+ int value = (data[9] << 24) + (data[10] << 16) + (data[11] << 8) + data[12];
58+ int year = (value >> 21) + 2000;
59+ int month = (value >> 17) & 0xf;
60+ int date = (value >> 12) & 0x1f;
61+ int hour = (value >> 6) & 0x3f;
62+ int min = value & 0x3f;
63+ t.date = new DateTime(year, month, date, hour, min, 0);
64+
65+ // 金額
66+ value = (data[1] << 24) + (data[2] << 16) + (data[3] << 8) + data[4];
67+
68+ // 種別
69+ switch (data[0])
70+ {
71+ case 0x47:
72+ default:
73+ t.type = TransType.Debit; // 支払い
74+ t.desc = "nanaco支払";
75+ t.value = - value;
76+ break;
77+ case 0x6f:
78+ t.type = TransType.DirectDep; // チャージ
79+ t.desc = "nanacoチャージ";
80+ t.value = value;
81+ break;
82+ case 0x83:
83+ t.type = TransType.DirectDep;
84+ t.desc = "nanacoポイント交換";
85+ t.value = value;
86+ break;
87+ }
88+ t.memo = "";
89+
90+ // 残高
91+ value = (data[5] << 24) + (data[6] << 16) + (data[7] << 8) + data[8];
92+ t.balance = value;
93+
94+ // 連番
95+ value = (data[13] << 8) + data[14];
96+ t.id = value;
97+
98+ return true;
99+ }
100+ }
101+}
--- tags/FeliCa2Money-2.2/MainForm.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/MainForm.cs (revision 109)
@@ -0,0 +1,157 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.ComponentModel;
24+using System.Data;
25+using System.Drawing;
26+using System.Text;
27+using System.Windows.Forms;
28+
29+namespace FeliCa2Money
30+{
31+ public partial class MainForm : Form
32+ {
33+ public MainForm()
34+ {
35+ InitializeComponent();
36+
37+ Properties.Settings.Default.Upgrade();
38+ }
39+
40+ private void buttonQuit_Click(object sender, EventArgs e)
41+ {
42+ Application.Exit();
43+ }
44+
45+ private void buttonEdy_Click(object sender, EventArgs e)
46+ {
47+ using (Edy edy = new Edy())
48+ {
49+ doConvert(edy);
50+ }
51+ }
52+
53+ private void buttonSuica_Click(object sender, EventArgs e)
54+ {
55+ using (Suica suica = new Suica())
56+ {
57+ doConvert(suica);
58+ }
59+ }
60+
61+ private void buttonNanaco_Click(object sender, EventArgs e)
62+ {
63+ using(Nanaco nanaco = new Nanaco())
64+ {
65+ doConvert(nanaco);
66+ }
67+ }
68+
69+ private void doConvert(Card c)
70+ {
71+ List<Transaction> list;
72+
73+ try
74+ {
75+ list = c.ReadCard();
76+ }
77+ catch (Exception ex)
78+ {
79+ MessageBox.Show(ex.Message, "エラー");
80+ return;
81+ }
82+
83+ if (list == null)
84+ {
85+ MessageBox.Show("カードを読むことができませんでした", "エラー");
86+ return;
87+ }
88+
89+ // 0円の取引を削除する
90+ if (Properties.Settings.Default.IgnoreZeroTransaction)
91+ {
92+ list.RemoveAll(Transaction.isZeroTransaction);
93+ }
94+
95+ if (list.Count == 0)
96+ {
97+ MessageBox.Show("履歴が一件もありません", "エラー");
98+ return;
99+ }
100+
101+ // OFX ファイルパス指定
102+ String ofxFilePath;
103+ if (Properties.Settings.Default.ManualOfxPath)
104+ {
105+ if (saveFileDialog.ShowDialog() == DialogResult.OK)
106+ {
107+ ofxFilePath = saveFileDialog.FileName;
108+ }
109+ else
110+ {
111+ // do not save
112+ return;
113+ }
114+ }
115+ else
116+ {
117+ ofxFilePath = System.IO.Path.GetTempPath() + "FeliCa2Money.ofx";
118+ }
119+
120+ // OFX ファイル生成
121+ OfxFile ofx = new OfxFile();
122+ ofx.SetOfxFilePath(ofxFilePath);
123+ ofx.WriteFile(c, list);
124+
125+ // Money 起動
126+ if (Properties.Settings.Default.AutoKickOfxFile)
127+ {
128+ ofx.Execute();
129+ }
130+ }
131+
132+ // 設定ダイアログ
133+ private void buttonOption_Click(object sender, EventArgs e)
134+ {
135+ OptionDialog dlg = new OptionDialog();
136+
137+ if (dlg.ShowDialog() == DialogResult.OK)
138+ {
139+ dlg.SaveProperties();
140+ }
141+ }
142+
143+ private void buttonManual_Click(object sender, EventArgs e)
144+ {
145+ try
146+ {
147+ String helpFile = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\Felica2Money.html";
148+ System.Diagnostics.Process.Start(helpFile);
149+ }
150+ catch
151+ {
152+ // do nothing
153+ }
154+ }
155+
156+ }
157+}
--- tags/FeliCa2Money-2.2/Card.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Card.cs (revision 109)
@@ -0,0 +1,109 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using FelicaLib;
25+
26+namespace FeliCa2Money
27+{
28+ abstract class Card
29+ {
30+ protected string ident;
31+ protected string cardName;
32+ protected string cardId;
33+
34+ public abstract List<Transaction> ReadCard();
35+
36+ public string Ident
37+ {
38+ get { return this.ident; }
39+ }
40+
41+ public string CardName
42+ {
43+ get { return this.cardName; }
44+ }
45+
46+ public string CardId
47+ {
48+ set { this.cardId = value; }
49+ get { return this.cardId; }
50+ }
51+
52+ protected string[] ParseLine(string line)
53+ {
54+ return line.Split('\t');
55+ }
56+ }
57+
58+ abstract class CardWithFelicaLib : Card, IDisposable
59+ {
60+ protected int systemCode; // システムコード
61+ protected int serviceCode; // サービスコード
62+ protected bool needReverse; // レコード順序を逆転するかどうか
63+
64+ // カード ID 取得
65+ public abstract void analyzeCardId(Felica f);
66+
67+ // Transaction 解析
68+ public abstract bool analyzeTransaction(Transaction t, byte[] data);
69+
70+ public override List<Transaction> ReadCard()
71+ {
72+ List<Transaction> list = new List<Transaction>();
73+
74+ using (Felica f = new Felica())
75+ {
76+ f.Polling(systemCode);
77+ analyzeCardId(f);
78+
79+ for (int i = 0; ; i++)
80+ {
81+ byte[] data = f.ReadWithoutEncryption(serviceCode, i);
82+ if (data == null) break;
83+
84+ Transaction t = new Transaction();
85+ if (analyzeTransaction(t, data))
86+ {
87+ list.Add(t);
88+ }
89+ }
90+ }
91+ if (needReverse)
92+ {
93+ list.Reverse();
94+ }
95+ PostProcess(list);
96+
97+ return list;
98+ }
99+
100+ protected virtual void PostProcess(List<Transaction> list)
101+ {
102+ // do nothing
103+ }
104+
105+ public virtual void Dispose()
106+ {
107+ }
108+ }
109+}
--- tags/FeliCa2Money-2.2/MainForm.Designer.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/MainForm.Designer.cs (revision 109)
@@ -0,0 +1,235 @@
1+namespace FeliCa2Money
2+{
3+ partial class MainForm
4+ {
5+ /// <summary>
6+ /// 必要なデザイナ変数です。
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// 使用中のリソースをすべてクリーンアップします。
12+ /// </summary>
13+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows フォーム デザイナで生成されたコード
24+
25+ /// <summary>
26+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
27+ /// コード エディタで変更しないでください。
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
32+ this.buttonEdy = new System.Windows.Forms.Button();
33+ this.buttonSuica = new System.Windows.Forms.Button();
34+ this.buttonQuit = new System.Windows.Forms.Button();
35+ this.buttonOption = new System.Windows.Forms.Button();
36+ this.label1 = new System.Windows.Forms.Label();
37+ this.label2 = new System.Windows.Forms.Label();
38+ this.label3 = new System.Windows.Forms.Label();
39+ this.label4 = new System.Windows.Forms.Label();
40+ this.label5 = new System.Windows.Forms.Label();
41+ this.buttonManual = new System.Windows.Forms.Button();
42+ this.label6 = new System.Windows.Forms.Label();
43+ this.buttonNanaco = new System.Windows.Forms.Button();
44+ this.label7 = new System.Windows.Forms.Label();
45+ this.label8 = new System.Windows.Forms.Label();
46+ this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
47+ this.SuspendLayout();
48+ //
49+ // buttonEdy
50+ //
51+ this.buttonEdy.Image = global::FeliCa2Money.Properties.Resources.Edy;
52+ this.buttonEdy.Location = new System.Drawing.Point(12, 12);
53+ this.buttonEdy.Name = "buttonEdy";
54+ this.buttonEdy.Size = new System.Drawing.Size(58, 58);
55+ this.buttonEdy.TabIndex = 1;
56+ this.buttonEdy.UseVisualStyleBackColor = true;
57+ this.buttonEdy.Click += new System.EventHandler(this.buttonEdy_Click);
58+ //
59+ // buttonSuica
60+ //
61+ this.buttonSuica.Image = global::FeliCa2Money.Properties.Resources.Suica;
62+ this.buttonSuica.Location = new System.Drawing.Point(12, 76);
63+ this.buttonSuica.Name = "buttonSuica";
64+ this.buttonSuica.Size = new System.Drawing.Size(58, 58);
65+ this.buttonSuica.TabIndex = 4;
66+ this.buttonSuica.UseVisualStyleBackColor = true;
67+ this.buttonSuica.Click += new System.EventHandler(this.buttonSuica_Click);
68+ //
69+ // buttonQuit
70+ //
71+ this.buttonQuit.Location = new System.Drawing.Point(127, 341);
72+ this.buttonQuit.Name = "buttonQuit";
73+ this.buttonQuit.Size = new System.Drawing.Size(94, 30);
74+ this.buttonQuit.TabIndex = 10;
75+ this.buttonQuit.Text = "終了";
76+ this.buttonQuit.UseVisualStyleBackColor = true;
77+ this.buttonQuit.Click += new System.EventHandler(this.buttonQuit_Click);
78+ //
79+ // buttonOption
80+ //
81+ this.buttonOption.Location = new System.Drawing.Point(12, 204);
82+ this.buttonOption.Name = "buttonOption";
83+ this.buttonOption.Size = new System.Drawing.Size(58, 58);
84+ this.buttonOption.TabIndex = 7;
85+ this.buttonOption.Text = "設定";
86+ this.buttonOption.UseVisualStyleBackColor = true;
87+ this.buttonOption.Click += new System.EventHandler(this.buttonOption_Click);
88+ //
89+ // label1
90+ //
91+ this.label1.AutoSize = true;
92+ this.label1.Location = new System.Drawing.Point(76, 26);
93+ this.label1.Name = "label1";
94+ this.label1.Size = new System.Drawing.Size(226, 12);
95+ this.label1.TabIndex = 0;
96+ this.label1.Text = "PaSoRiを使って Edy の利用履歴を Microsoft";
97+ this.label1.UseWaitCursor = true;
98+ //
99+ // label2
100+ //
101+ this.label2.AutoSize = true;
102+ this.label2.Location = new System.Drawing.Point(76, 87);
103+ this.label2.Name = "label2";
104+ this.label2.Size = new System.Drawing.Size(271, 12);
105+ this.label2.TabIndex = 3;
106+ this.label2.Text = "PaSoRiを使って Suica/ICOCAなど交通系電子マネーの";
107+ //
108+ // label3
109+ //
110+ this.label3.AutoSize = true;
111+ this.label3.Location = new System.Drawing.Point(76, 99);
112+ this.label3.Name = "label3";
113+ this.label3.Size = new System.Drawing.Size(234, 12);
114+ this.label3.TabIndex = 5;
115+ this.label3.Text = "利用履歴を Microsoft Money に取り込みます。";
116+ //
117+ // label4
118+ //
119+ this.label4.AutoSize = true;
120+ this.label4.Location = new System.Drawing.Point(76, 38);
121+ this.label4.Name = "label4";
122+ this.label4.Size = new System.Drawing.Size(121, 12);
123+ this.label4.TabIndex = 2;
124+ this.label4.Text = "Money に取り込みます。";
125+ //
126+ // label5
127+ //
128+ this.label5.AutoSize = true;
129+ this.label5.Location = new System.Drawing.Point(76, 227);
130+ this.label5.Name = "label5";
131+ this.label5.Size = new System.Drawing.Size(111, 12);
132+ this.label5.TabIndex = 6;
133+ this.label5.Text = "各種設定を行います。";
134+ //
135+ // buttonManual
136+ //
137+ this.buttonManual.Location = new System.Drawing.Point(12, 268);
138+ this.buttonManual.Name = "buttonManual";
139+ this.buttonManual.Size = new System.Drawing.Size(58, 58);
140+ this.buttonManual.TabIndex = 9;
141+ this.buttonManual.Text = "マニュアル";
142+ this.buttonManual.UseVisualStyleBackColor = true;
143+ this.buttonManual.Click += new System.EventHandler(this.buttonManual_Click);
144+ //
145+ // label6
146+ //
147+ this.label6.AutoSize = true;
148+ this.label6.Location = new System.Drawing.Point(76, 291);
149+ this.label6.Name = "label6";
150+ this.label6.Size = new System.Drawing.Size(193, 12);
151+ this.label6.TabIndex = 8;
152+ this.label6.Text = "FeliCa2Money のマニュアルを開きます。";
153+ //
154+ // buttonNanaco
155+ //
156+ this.buttonNanaco.Image = global::FeliCa2Money.Properties.Resources.Nanaco;
157+ this.buttonNanaco.Location = new System.Drawing.Point(12, 140);
158+ this.buttonNanaco.Name = "buttonNanaco";
159+ this.buttonNanaco.Size = new System.Drawing.Size(58, 58);
160+ this.buttonNanaco.TabIndex = 11;
161+ this.buttonNanaco.UseVisualStyleBackColor = true;
162+ this.buttonNanaco.Click += new System.EventHandler(this.buttonNanaco_Click);
163+ //
164+ // label7
165+ //
166+ this.label7.AutoSize = true;
167+ this.label7.Location = new System.Drawing.Point(76, 154);
168+ this.label7.Name = "label7";
169+ this.label7.Size = new System.Drawing.Size(243, 12);
170+ this.label7.TabIndex = 12;
171+ this.label7.Text = "PaSoRiを使って nanaco の利用履歴を Microsoft";
172+ //
173+ // label8
174+ //
175+ this.label8.AutoSize = true;
176+ this.label8.Location = new System.Drawing.Point(76, 166);
177+ this.label8.Name = "label8";
178+ this.label8.Size = new System.Drawing.Size(121, 12);
179+ this.label8.TabIndex = 13;
180+ this.label8.Text = "Money に取り込みます。";
181+ //
182+ // saveFileDialog
183+ //
184+ this.saveFileDialog.Filter = "OFX File(*.ofx)|*.ofx";
185+ //
186+ // MainForm
187+ //
188+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
189+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
190+ this.ClientSize = new System.Drawing.Size(363, 383);
191+ this.Controls.Add(this.label8);
192+ this.Controls.Add(this.label7);
193+ this.Controls.Add(this.buttonNanaco);
194+ this.Controls.Add(this.label6);
195+ this.Controls.Add(this.buttonManual);
196+ this.Controls.Add(this.label5);
197+ this.Controls.Add(this.label4);
198+ this.Controls.Add(this.label3);
199+ this.Controls.Add(this.label2);
200+ this.Controls.Add(this.label1);
201+ this.Controls.Add(this.buttonOption);
202+ this.Controls.Add(this.buttonQuit);
203+ this.Controls.Add(this.buttonSuica);
204+ this.Controls.Add(this.buttonEdy);
205+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
206+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
207+ this.MaximizeBox = false;
208+ this.Name = "MainForm";
209+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
210+ this.Text = "FeliCa2Money";
211+ this.ResumeLayout(false);
212+ this.PerformLayout();
213+
214+ }
215+
216+ #endregion
217+
218+ private System.Windows.Forms.Button buttonEdy;
219+ private System.Windows.Forms.Button buttonSuica;
220+ private System.Windows.Forms.Button buttonQuit;
221+ private System.Windows.Forms.Button buttonOption;
222+ private System.Windows.Forms.Label label1;
223+ private System.Windows.Forms.Label label2;
224+ private System.Windows.Forms.Label label3;
225+ private System.Windows.Forms.Label label4;
226+ private System.Windows.Forms.Label label5;
227+ private System.Windows.Forms.Button buttonManual;
228+ private System.Windows.Forms.Label label6;
229+ private System.Windows.Forms.Button buttonNanaco;
230+ private System.Windows.Forms.Label label7;
231+ private System.Windows.Forms.Label label8;
232+ private System.Windows.Forms.SaveFileDialog saveFileDialog;
233+ }
234+}
235+
--- tags/FeliCa2Money-2.2/FelicaLib.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/FelicaLib.cs (revision 109)
@@ -0,0 +1,119 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Text;
4+using System.Runtime.InteropServices;
5+
6+namespace FelicaLib
7+{
8+ // システムコード
9+ enum SystemCode : int
10+ {
11+ Any = 0xffff, // ANY
12+ Common = 0xfe00, // 共通領域
13+ Cyberne = 0x0003, // サイバネ領域
14+
15+ Edy = 0xfe00, // Edy (=共通領域)
16+ Suica = 0x0003, // Suica (=サイバネ領域)
17+ }
18+
19+ public class Felica : IDisposable
20+ {
21+ [DllImport("felicalib.dll")]
22+ private extern static IntPtr pasori_open(String dummy);
23+ [DllImport("felicalib.dll")]
24+ private extern static void pasori_close(IntPtr p);
25+ [DllImport("felicalib.dll")]
26+ private extern static int pasori_init(IntPtr p);
27+ [DllImport("felicalib.dll")]
28+ private extern static IntPtr felica_polling(IntPtr p, ushort systemcode, byte rfu, byte time_slot);
29+ [DllImport("felicalib.dll")]
30+ private extern static void felica_free(IntPtr f);
31+ [DllImport("felicalib.dll")]
32+ private extern static void felica_getidm(IntPtr f, byte[] data);
33+ [DllImport("felicalib.dll")]
34+ private extern static void felica_getpmm(IntPtr f, byte[] data);
35+ [DllImport("felicalib.dll")]
36+ private extern static int felica_read_without_encryption02(IntPtr f, int servicecode, int mode, byte addr, byte[] data);
37+
38+ private IntPtr pasorip = IntPtr.Zero;
39+ private IntPtr felicap = IntPtr.Zero;
40+
41+ public Felica()
42+ {
43+ pasorip = pasori_open(null);
44+ if (pasorip == IntPtr.Zero)
45+ {
46+ throw new Exception("felicalib.dll を開けません");
47+ }
48+ if (pasori_init(pasorip) != 0)
49+ {
50+ throw new Exception("PaSoRi に接続できません");
51+ }
52+ }
53+
54+ public void Dispose()
55+ {
56+ if (pasorip != IntPtr.Zero)
57+ {
58+ pasori_close(pasorip);
59+ pasorip = IntPtr.Zero;
60+ }
61+ }
62+
63+ ~Felica()
64+ {
65+ Dispose();
66+ }
67+
68+ public void Polling(int systemcode)
69+ {
70+ felica_free(felicap);
71+
72+ felicap = felica_polling(pasorip, (ushort)systemcode, 0, 0);
73+ if (felicap == IntPtr.Zero)
74+ {
75+ throw new Exception("カード読み取り失敗");
76+ }
77+ }
78+
79+ public byte[] IDm()
80+ {
81+ if (felicap == IntPtr.Zero)
82+ {
83+ throw new Exception("no polling executed.");
84+ }
85+
86+ byte[] buf = new byte[8];
87+ felica_getidm(felicap, buf);
88+ return buf;
89+ }
90+
91+ public byte[] PMm()
92+ {
93+ if (felicap == IntPtr.Zero)
94+ {
95+ throw new Exception("no polling executed.");
96+ }
97+
98+ byte[] buf = new byte[8];
99+ felica_getpmm(felicap, buf);
100+ return buf;
101+ }
102+
103+ public byte[] ReadWithoutEncryption(int servicecode, int addr)
104+ {
105+ if (felicap == IntPtr.Zero)
106+ {
107+ throw new Exception("no polling executed.");
108+ }
109+
110+ byte[] data = new byte[16];
111+ int ret = felica_read_without_encryption02(felicap, servicecode, 0, (byte)addr, data);
112+ if (ret != 0)
113+ {
114+ return null;
115+ }
116+ return data;
117+ }
118+ }
119+}
--- tags/FeliCa2Money-2.2/SfcPeep.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/SfcPeep.cs (revision 109)
@@ -0,0 +1,63 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using System.Diagnostics;
25+
26+namespace FeliCa2Money
27+{
28+ class SfcPeep
29+ {
30+ private List<string> lines;
31+
32+ // SFCPeep を実行し、実行結果の文字列リストを返す
33+ public List<string> Execute(string arg)
34+ {
35+ lines = new List<string>();
36+
37+ string SfcPeepPath = FeliCa2Money.Properties.Settings.Default.SFCPeepPath;
38+
39+ Process p = new Process();
40+ p.StartInfo.FileName = SfcPeepPath;
41+ p.StartInfo.Arguments = arg;
42+ p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(SfcPeepPath);
43+ p.StartInfo.UseShellExecute = false;
44+ p.StartInfo.RedirectStandardOutput = true;
45+ p.StartInfo.CreateNoWindow = true;
46+ p.OutputDataReceived += new DataReceivedEventHandler(EventHandler_OutputDataReceived);
47+ p.Start();
48+
49+ p.BeginOutputReadLine();
50+ p.WaitForExit();
51+
52+ return lines;
53+ }
54+
55+ private void EventHandler_OutputDataReceived(object sender, DataReceivedEventArgs ev)
56+ {
57+ if (ev.Data != null)
58+ {
59+ lines.Add(ev.Data);
60+ }
61+ }
62+ }
63+}
--- tags/FeliCa2Money-2.2/Transaction.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Transaction.cs (revision 109)
@@ -0,0 +1,120 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using System.Collections;
25+
26+namespace FeliCa2Money
27+{
28+ enum TransType
29+ {
30+ Int, // 利息
31+ Div, // 配当
32+ DirectDep, // 振り込み入金、取り立て入金、自動引き落とし戻し入金
33+ Dep, // その他入金
34+
35+ Payment,
36+ Cash,
37+ ATM,
38+ Check,
39+ Debit // その他出金
40+ }
41+
42+ class Transaction
43+ {
44+ public int id; // ID
45+ public DateTime date;
46+ public TransType type; // トランザクションタイプ
47+ public string desc;
48+ public string memo;
49+ public int value; // 金額
50+ public int balance; // 残高
51+
52+ private static Hashtable TransIncome;
53+ private static Hashtable TransOutgo;
54+ private static Hashtable TransStrings;
55+
56+ static Transaction()
57+ {
58+ // initialize
59+ TransStrings = new Hashtable();
60+ TransStrings[TransType.Int] = "INT";
61+ TransStrings[TransType.Div] = "DIV";
62+ TransStrings[TransType.DirectDep] = "DIRECTDEP";
63+ TransStrings[TransType.Dep] = "DEP";
64+ TransStrings[TransType.Payment] = "PAYMENT";
65+ TransStrings[TransType.Cash] = "CASH";
66+ TransStrings[TransType.ATM] = "ATM";
67+ TransStrings[TransType.Check] = "CHECK";
68+ TransStrings[TransType.Debit] = "DEBIT";
69+
70+ TransIncome = new Hashtable();
71+ TransIncome["利息"] = TransType.Int;
72+ TransIncome["振込"] = TransType.DirectDep;
73+ TransIncome["チャージ"]= TransType.DirectDep; // Edy チャージ
74+ TransIncome["入金"] = TransType.DirectDep; // Suica チャージ
75+
76+ TransOutgo = new Hashtable();
77+ TransOutgo["ATM"] = TransType.ATM;
78+ TransOutgo["ATM"] = TransType.ATM;
79+ }
80+
81+ public string GetTransString()
82+ {
83+ return (string)TransStrings[type];
84+ }
85+
86+ public void GuessTransType(bool isIncome)
87+ {
88+ Hashtable h = TransOutgo;
89+
90+ if (isIncome)
91+ {
92+ h = TransIncome;
93+ }
94+
95+ foreach (string key in h.Keys)
96+ {
97+ if (desc.Contains(key))
98+ {
99+ type = (TransType)h[key];
100+ return;
101+ }
102+ }
103+
104+ // no match
105+ if (isIncome)
106+ {
107+ type = TransType.Dep;
108+ }
109+ else
110+ {
111+ type = TransType.Debit;
112+ }
113+ }
114+
115+ public static bool isZeroTransaction(Transaction t)
116+ {
117+ return t.value == 0;
118+ }
119+ }
120+}
--- tags/FeliCa2Money-2.2/OfxFile.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/OfxFile.cs (revision 109)
@@ -0,0 +1,160 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Text;
24+using System.IO;
25+
26+namespace FeliCa2Money
27+{
28+ class OfxFile
29+ {
30+ private string ofxFilePath;
31+
32+ public OfxFile()
33+ {
34+ }
35+
36+ public void SetOfxFilePath(String path)
37+ {
38+ ofxFilePath = path;
39+ }
40+
41+ private string dateStr(DateTime d)
42+ {
43+ string s = String.Format("{0}{1:00}{2:00}", d.Year, d.Month, d.Day);
44+ s += String.Format("{0:00}{1:00}{2:00}", d.Hour, d.Minute, d.Second);
45+ s += "[+9:JST]";
46+ return s;
47+ }
48+
49+ private string transId(Transaction t)
50+ {
51+ /* トランザクションの ID は日付と取引番号で生成 */
52+ string longId = String.Format("{0:0000}{1:00}{2:00}", t.date.Year, t.date.Month, t.date.Day);
53+ longId += String.Format("{0:0000000}", t.id);
54+ return longId;
55+ }
56+
57+ public void WriteFile(Card card, List<Transaction> transactions)
58+ {
59+ Transaction first = transactions[0];
60+ Transaction last = transactions[transactions.Count - 1];
61+
62+ StreamWriter w = new StreamWriter(ofxFilePath, false); //, Encoding.UTF8);
63+ w.NewLine = "\n";
64+
65+ w.WriteLine("OFXHEADER:100");
66+ w.WriteLine("DATA:OFXSGML");
67+ w.WriteLine("VERSION:102");
68+ w.WriteLine("SECURITY:NONE");
69+ w.WriteLine("ENCODING:UTF-8");
70+ w.WriteLine("CHARSET:CSUNICODE");
71+ w.WriteLine("COMPRESSION:NONE");
72+ w.WriteLine("OLDFILEUID:NONE");
73+ w.WriteLine("NEWFILEUID:NONE");
74+ w.WriteLine("");
75+
76+ /* 金融機関情報(サインオンレスポンス) */
77+ w.WriteLine("<OFX>");
78+ w.WriteLine("<SIGNONMSGSRSV1>");
79+ w.WriteLine("<SONRS>");
80+ w.WriteLine(" <STATUS>");
81+ w.WriteLine(" <CODE>0");
82+ w.WriteLine(" <SEVERITY>INFO");
83+ w.WriteLine(" </STATUS>");
84+ w.WriteLine(" <DTSERVER>{0}", dateStr(last.date));
85+
86+ w.WriteLine(" <LANGUAGE>JPN");
87+ w.WriteLine(" <FI>");
88+ w.WriteLine(" <ORG>{0}", card.Ident);
89+ w.WriteLine(" </FI>");
90+ w.WriteLine("</SONRS>");
91+ w.WriteLine("</SIGNONMSGSRSV1>");
92+
93+ /* 口座情報(バンクメッセージレスポンス) */
94+ w.WriteLine("<BANKMSGSRSV1>");
95+
96+ /* 預金口座型明細情報作成 */
97+ w.WriteLine("<STMTTRNRS>");
98+ w.WriteLine("<TRNUID>0");
99+ w.WriteLine("<STATUS>");
100+ w.WriteLine(" <CODE>0");
101+ w.WriteLine(" <SEVERITY>INFO");
102+ w.WriteLine("</STATUS>");
103+
104+ w.WriteLine("<STMTRS>");
105+ w.WriteLine(" <CURDEF>JPY");
106+
107+ w.WriteLine(" <BANKACCTFROM>");
108+ w.WriteLine(" <BANKID>{0}", card.Ident);
109+ w.WriteLine(" <BRANCHID>000");
110+ w.WriteLine(" <ACCTID>{0}", card.CardId);
111+ w.WriteLine(" <ACCTTYPE>SAVINGS");
112+ w.WriteLine(" </BANKACCTFROM>");
113+
114+ /* 明細情報開始(バンクトランザクションリスト) */
115+ w.WriteLine(" <BANKTRANLIST>");
116+ w.WriteLine(" <DTSTART>{0}", dateStr(first.date));
117+ w.WriteLine(" <DTEND>{0}", dateStr(last.date));
118+
119+ /* トランザクション */
120+ foreach (Transaction t in transactions)
121+ {
122+ w.WriteLine(" <STMTTRN>");
123+ w.WriteLine(" <TRNTYPE>{0}", t.GetTransString());
124+ w.WriteLine(" <DTPOSTED>{0}", dateStr(t.date));
125+ w.WriteLine(" <TRNAMT>{0}", t.value);
126+
127+ /* トランザクションの ID は日付と取引番号で生成 */
128+ w.WriteLine(" <FITID>{0}", transId(t));
129+ w.WriteLine(" <NAME>{0}", t.desc);
130+ if (t.memo != null)
131+ {
132+ w.WriteLine(" <MEMO>{0}", t.memo);
133+ }
134+ w.WriteLine(" </STMTTRN>");
135+ }
136+
137+ w.WriteLine(" </BANKTRANLIST>");
138+
139+ /* 残高 */
140+ w.WriteLine(" <LEDGERBAL>");
141+ w.WriteLine(" <BALAMT>{0}", last.balance);
142+ w.WriteLine(" <DTASOF>{0}", dateStr(last.date));
143+ w.WriteLine(" </LEDGERBAL>");
144+
145+ /* OFX 終了 */
146+ w.WriteLine(" </STMTRS>");
147+ w.WriteLine("</STMTTRNRS>");
148+ w.WriteLine("</BANKMSGSRSV1>");
149+ w.WriteLine("</OFX>");
150+
151+ w.Close();
152+
153+ }
154+
155+ public void Execute()
156+ {
157+ System.Diagnostics.Process.Start(ofxFilePath);
158+ }
159+ }
160+}
--- tags/FeliCa2Money-2.2/Program.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Program.cs (revision 109)
@@ -0,0 +1,40 @@
1+/*
2+ * FeliCa2Money
3+ *
4+ * Copyright (C) 2001-2008 Takuya Murakami
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program; if not, write to the Free Software
18+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+ */
20+
21+using System;
22+using System.Collections.Generic;
23+using System.Windows.Forms;
24+
25+namespace FeliCa2Money
26+{
27+ static class Program
28+ {
29+ /// <summary>
30+ /// アプリケーションのメイン エントリ ポイントです。
31+ /// </summary>
32+ [STAThread]
33+ static void Main()
34+ {
35+ Application.EnableVisualStyles();
36+ Application.SetCompatibleTextRenderingDefault(false);
37+ Application.Run(new MainForm());
38+ }
39+ }
40+}
\ No newline at end of file
--- tags/FeliCa2Money-2.2/Settings.cs (nonexistent)
+++ tags/FeliCa2Money-2.2/Settings.cs (revision 109)
@@ -0,0 +1,28 @@
1+namespace FeliCa2Money.Properties {
2+
3+
4+ // このクラスでは設定クラスでの特定のイベントを処理することができます:
5+ // SettingChanging イベントは、設定値が変更される前に発生します。
6+ // PropertyChanged イベントは、設定値が変更された後に発生します。
7+ // SettingsLoaded イベントは、設定値が読み込まれた後に発生します。
8+ // SettingsSaving イベントは、設定値が保存される前に発生します。
9+ internal sealed partial class Settings {
10+
11+ public Settings() {
12+ // // 設定の保存と変更のイベント ハンドラを追加するには、以下の行のコメントを解除します:
13+ //
14+ // this.SettingChanging += this.SettingChangingEventHandler;
15+ //
16+ // this.SettingsSaving += this.SettingsSavingEventHandler;
17+ //
18+ }
19+
20+ private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
21+ // SettingChangingEvent イベントを処理するコードをここに追加してください。
22+ }
23+
24+ private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
25+ // SettingsSaving イベントを処理するコードをここに追加してください。
26+ }
27+ }
28+}
Show on old repository browser