From 0bd24e8d330431ca93a3e69c942d348e80ee6f5c Mon Sep 17 00:00:00 2001 From: hanel2527 Date: Thu, 18 Jul 2019 16:37:28 +0900 Subject: [PATCH] =?UTF-8?q?v2.0.10=20-=20=EC=A0=80=EC=9E=A5=20=EB=B2=94?= =?UTF-8?q?=EC=9C=84=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Form1.Designer.cs | 24 +++++++++--------- Form1.cs | 2 +- gallchangranking.cs | 12 +++++++-- saveFileForm.Designer.cs | 54 +++++++++++++++++++++++++++++++++++++--- saveFileForm.cs | 8 ++++-- 5 files changed, 79 insertions(+), 21 deletions(-) diff --git a/Form1.Designer.cs b/Form1.Designer.cs index acbb20b..d2769b6 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -29,6 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.dataToText = new System.Windows.Forms.TabPage(); + this.SaveButton = new System.Windows.Forms.Button(); this.cancelAllCheck = new System.Windows.Forms.Button(); this.userListView = new System.Windows.Forms.ListView(); this.index = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -65,7 +66,6 @@ private void InitializeComponent() this.isMinor = new System.Windows.Forms.CheckBox(); this.pageProgressBar = new System.Windows.Forms.ProgressBar(); this.tabPages = new System.Windows.Forms.TabControl(); - this.SaveButton = new System.Windows.Forms.Button(); this.dataToText.SuspendLayout(); this.gcrkCrawler.SuspendLayout(); this.tabPages.SuspendLayout(); @@ -89,6 +89,16 @@ private void InitializeComponent() this.dataToText.Text = "동일닉 처리 및 텍스트 파일로 저장"; this.dataToText.UseVisualStyleBackColor = true; // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(676, 405); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(107, 52); + this.SaveButton.TabIndex = 13; + this.SaveButton.Text = "파일 저장"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); + // // cancelAllCheck // this.cancelAllCheck.Location = new System.Drawing.Point(701, 216); @@ -435,16 +445,6 @@ private void InitializeComponent() this.tabPages.Size = new System.Drawing.Size(798, 506); this.tabPages.TabIndex = 0; // - // SaveButton - // - this.SaveButton.Location = new System.Drawing.Point(676, 405); - this.SaveButton.Name = "SaveButton"; - this.SaveButton.Size = new System.Drawing.Size(107, 52); - this.SaveButton.TabIndex = 13; - this.SaveButton.Text = "파일 저장"; - this.SaveButton.UseVisualStyleBackColor = true; - this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); @@ -452,7 +452,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(800, 501); this.Controls.Add(this.tabPages); this.Name = "Form1"; - this.Text = "갤창랭킹.v2.0.9"; + this.Text = "갤창랭킹.v2.0.10"; this.Load += new System.EventHandler(this.Form1_Load); this.dataToText.ResumeLayout(false); this.dataToText.PerformLayout(); diff --git a/Form1.cs b/Form1.cs index 0d3ac85..ed14489 100644 --- a/Form1.cs +++ b/Form1.cs @@ -15,7 +15,7 @@ namespace DcCrawler.WF { public partial class Form1 : Form { - public string version = "v2.0.9"; + public string version = "v2.0.10"; public Form1() { InitializeComponent(); diff --git a/gallchangranking.cs b/gallchangranking.cs index 87e2689..6078772 100644 --- a/gallchangranking.cs +++ b/gallchangranking.cs @@ -618,7 +618,7 @@ orderby userRank.count descending select userRank; userList = sorted.ToList(); } - public void SaveToText(string filename) + public void SaveToText(string filename, int maximumRank, int minimumCount) { string resultDir = Directory.GetCurrentDirectory() + "\\results\\"; Directory.CreateDirectory(resultDir); @@ -651,6 +651,10 @@ public void SaveToText(string filename) { rank = index; } + if (rank > maximumRank || userList[i].count < minimumCount) + { + break; + } gallShare = (double)(10000 * userList[i].count / totalCount) / 100.0; string str = rank.ToString() + "위\t" + userList[i].ToString() + "\t" + userList[i].count.ToString() + "글\t" + gallShare.ToString() + "%"; sw.WriteLine(str); @@ -667,7 +671,7 @@ private string TableMaker(string[] strArr) } return str + ""; } - public void SaveToTable(string filename) + public void SaveToTable(string filename, int maximumRank, int minimumCount) { string resultDir = Directory.GetCurrentDirectory() + "\\results\\"; Directory.CreateDirectory(resultDir); @@ -703,6 +707,10 @@ public void SaveToTable(string filename) { rank = index; } + if (rank > maximumRank || userList[i].count < minimumCount) + { + break; + } gallShare = (double)(10000 * userList[i].count / totalCount) / 100.0; strArr[0] = rank.ToString(); strArr[1] = userList[i].ToString("Nick"); strArr[2] = userList[i].ToString("IdorIp"); strArr[3] = userList[i].count.ToString(); diff --git a/saveFileForm.Designer.cs b/saveFileForm.Designer.cs index 574ab6e..928b11d 100644 --- a/saveFileForm.Designer.cs +++ b/saveFileForm.Designer.cs @@ -33,11 +33,15 @@ private void InitializeComponent() this.filenameTextBox = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.explainLinkLabel = new System.Windows.Forms.LinkLabel(); + this.maximumRankTextBox = new System.Windows.Forms.TextBox(); + this.minimumCountTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // SaveAsText // - this.SaveAsText.Location = new System.Drawing.Point(12, 94); + this.SaveAsText.Location = new System.Drawing.Point(12, 170); this.SaveAsText.Name = "SaveAsText"; this.SaveAsText.Size = new System.Drawing.Size(120, 49); this.SaveAsText.TabIndex = 0; @@ -47,7 +51,7 @@ private void InitializeComponent() // // SaveAsTable // - this.SaveAsTable.Location = new System.Drawing.Point(156, 94); + this.SaveAsTable.Location = new System.Drawing.Point(150, 170); this.SaveAsTable.Name = "SaveAsTable"; this.SaveAsTable.Size = new System.Drawing.Size(120, 49); this.SaveAsTable.TabIndex = 1; @@ -74,7 +78,7 @@ private void InitializeComponent() // explainLinkLabel // this.explainLinkLabel.AutoSize = true; - this.explainLinkLabel.Location = new System.Drawing.Point(299, 128); + this.explainLinkLabel.Location = new System.Drawing.Point(289, 204); this.explainLinkLabel.Name = "explainLinkLabel"; this.explainLinkLabel.Size = new System.Drawing.Size(137, 15); this.explainLinkLabel.TabIndex = 6; @@ -82,11 +86,49 @@ private void InitializeComponent() this.explainLinkLabel.Text = "표로 저장 사용방법"; this.explainLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.explainLinkLabel_LinkClicked); // + // maximumRankTextBox + // + this.maximumRankTextBox.Location = new System.Drawing.Point(16, 85); + this.maximumRankTextBox.Name = "maximumRankTextBox"; + this.maximumRankTextBox.Size = new System.Drawing.Size(100, 25); + this.maximumRankTextBox.TabIndex = 9; + this.maximumRankTextBox.Text = "300"; + // + // minimumCountTextBox + // + this.minimumCountTextBox.Location = new System.Drawing.Point(16, 139); + this.minimumCountTextBox.Name = "minimumCountTextBox"; + this.minimumCountTextBox.Size = new System.Drawing.Size(100, 25); + this.minimumCountTextBox.TabIndex = 10; + this.minimumCountTextBox.Text = "3"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 63); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(157, 15); + this.label2.TabIndex = 11; + this.label2.Text = "일정 랭킹 이하만 출력"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(16, 121); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(162, 15); + this.label3.TabIndex = 12; + this.label3.Text = "일정 글 수 이상만 출력"; + // // saveFileForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(462, 159); + this.ClientSize = new System.Drawing.Size(462, 242); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.minimumCountTextBox); + this.Controls.Add(this.maximumRankTextBox); this.Controls.Add(this.explainLinkLabel); this.Controls.Add(this.label1); this.Controls.Add(this.filenameTextBox); @@ -107,5 +149,9 @@ private void InitializeComponent() private System.Windows.Forms.TextBox filenameTextBox; private System.Windows.Forms.Label label1; private System.Windows.Forms.LinkLabel explainLinkLabel; + private System.Windows.Forms.TextBox maximumRankTextBox; + private System.Windows.Forms.TextBox minimumCountTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; } } \ No newline at end of file diff --git a/saveFileForm.cs b/saveFileForm.cs index 993a2a3..438fcf9 100644 --- a/saveFileForm.cs +++ b/saveFileForm.cs @@ -29,14 +29,18 @@ private void saveFileForm_Load(object sender, EventArgs e) private void SaveAsText_Click(object sender, EventArgs e) { - dtt.SaveToText(this.filenameTextBox.Text); + int maximumRank = int.Parse(maximumRankTextBox.Text); + int minimumCount = int.Parse(minimumCountTextBox.Text); + dtt.SaveToText(this.filenameTextBox.Text, maximumRank, minimumCount); this.DialogResult = System.Windows.Forms.DialogResult.OK; } private void SaveAsTable_Click(object sender, EventArgs e) { - dtt.SaveToTable(this.filenameTextBox.Text); + int maximumRank = int.Parse(maximumRankTextBox.Text); + int minimumCount = int.Parse(minimumCountTextBox.Text); + dtt.SaveToTable(this.filenameTextBox.Text, maximumRank, minimumCount); this.DialogResult = System.Windows.Forms.DialogResult.OK; }