• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguiwindowsc翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

将棋ウォーズ棋譜を検索条件を指定して一括でダウンロードする。


コミットメタ情報

リビジョン8 (tree)
日時2015-01-28 22:05:27
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmCondtion.vb (revision 7)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/frmCondtion.vb (revision 8)
@@ -20,10 +20,9 @@
2020 Dim frm As New frmProgress
2121 Dim downloder As New downloder(
2222 frm.BackgroundWorker1,
23- txtSaveDirectory.Text,
2423 txtName1.Text,
25- txtName2.Text,
26- GetGTypeValue())
24+ txtName2.Text)
25+ downloder.AddGtypeDirectoryPair(New gTypeDirectoryPair(GetGTypeValue(), txtSaveDirectory.Text))
2726 frm.downLoder = downloder
2827 frm.ShowDialog()
2928
--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/gTypeDirectoryPair.vb (nonexistent)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/gTypeDirectoryPair.vb (revision 8)
@@ -0,0 +1,14 @@
1+Public Class gTypeDirectoryPair
2+
3+ Public Property gType As Integer
4+ Public Property saveDirectoryPathName As String
5+
6+ Private Sub New()
7+ End Sub
8+
9+ Public Sub New(gtype As Integer, saveDirectoryPathName As String)
10+ Me.gType = gtype
11+ Me.saveDirectoryPathName = saveDirectoryPathName
12+ End Sub
13+
14+End Class
--- ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/downloder.vb (revision 7)
+++ ShogiWarsKifuDownloader/ShogiWarsKifuDownloader/downloder.vb (revision 8)
@@ -6,10 +6,10 @@
66 Private downloadLists As IList(Of aLink)
77 Dim cc As System.Net.CookieContainer
88
9- Public Property saveDirectory As String
9+ Private _gTypePairList As New List(Of gTypeDirectoryPair)
10+
1011 Public Property name1 As String
1112 Public Property name2 As String
12- Public Property gType As Integer
1313 Public Property DownLoadsListsCount As Integer
1414 Public Property DownLoadIndex As Integer
1515 Public Property IsDownloading As Boolean = False
@@ -17,25 +17,29 @@
1717
1818 Private Sub New()
1919 End Sub
20- Public Sub New(ByVal bg As System.ComponentModel.BackgroundWorker,
21- ByVal saveDirectory As String, ByVal name1 As String, ByVal name2 As String, ByVal gType As Integer)
20+ Public Sub New(ByVal bg As System.ComponentModel.BackgroundWorker, ByVal name1 As String, ByVal name2 As String)
2221 _backGroudWoker = bg
23- _saveDirectory = saveDirectory
2422 _name1 = name1
2523 _name2 = name2
26- _gType = gType
2724 End Sub
2825
26+ Public Sub AddGtypeDirectoryPair(ByVal pair As gTypeDirectoryPair)
27+ _gTypePairList.Add(pair)
28+ End Sub
29+
2930 Public Sub Start()
3031 _backGroudWoker.ReportProgress(0, "ログイン開始")
3132 LoginReq()
32- _backGroudWoker.ReportProgress(0, "一覧取得中")
33- ListPageReadReq()
34- _backGroudWoker.ReportProgress(0, "ダウンロード開始")
35- DownLoadsReq()
33+ For Each p As gTypeDirectoryPair In _gTypePairList
34+ _backGroudWoker.ReportProgress(0, "一覧取得中")
35+ ListPageReadReq(p.gType)
36+ _backGroudWoker.ReportProgress(0, "ダウンロード開始")
37+ DownLoadsReq(p.saveDirectoryPathName)
38+ Next
3639 IsComplete = True
3740 _backGroudWoker.ReportProgress(100, "ダウンロード終了")
3841 End Sub
42+
3943 Private Sub LoginReq()
4044
4145 cc = New System.Net.CookieContainer()
@@ -59,11 +63,11 @@
5963
6064 End Sub
6165
62- Private Sub DownLoadsReq()
66+ Private Sub DownLoadsReq(ByVal saveDirectory As String)
6367
6468 Dim wc As New System.Net.WebClient()
6569
66- Dim dirfullpath As String = _saveDirectory
70+ Dim dirfullpath As String = saveDirectory
6771 If Not IOUtil.CreateDirectoryIfNotExist(dirfullpath) Then
6872 _backGroudWoker.ReportProgress(0, String.Format("ディレクトリ""{0}""が作成できません", dirfullpath))
6973 Exit Sub
@@ -107,13 +111,13 @@
107111
108112
109113
110- Private Sub ListPageReadReq()
114+ Private Sub ListPageReadReq(ByVal gType As Integer)
111115
112116 Dim ps As New Hashtable
113117 ps.Add("csrfmiddlewaretoken", csrfmiddlewaretoken)
114118 ps.Add("name1", _name1)
115119 ps.Add("name2", _name2)
116- ps.Add("gtype", _gType)
120+ ps.Add("gtype", gType)
117121
118122 Dim encoder As System.Text.Encoding = System.Text.Encoding.UTF8
119123