Skip to content

Commit

Permalink
v2.0.10 - 저장 범위 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
hanel2527 committed Jul 18, 2019
1 parent c798d89 commit 0bd24e8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 21 deletions.
24 changes: 12 additions & 12 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 10 additions & 2 deletions gallchangranking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ orderby userRank.count descending
select userRank;
userList = sorted.ToList<UserRank>();
}
public void SaveToText(string filename)
public void SaveToText(string filename, int maximumRank, int minimumCount)
{
string resultDir = Directory.GetCurrentDirectory() + "\\results\\";
Directory.CreateDirectory(resultDir);
Expand Down Expand Up @@ -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);
Expand All @@ -667,7 +671,7 @@ private string TableMaker(string[] strArr)
}
return str + "</tr>";
}
public void SaveToTable(string filename)
public void SaveToTable(string filename, int maximumRank, int minimumCount)
{
string resultDir = Directory.GetCurrentDirectory() + "\\results\\";
Directory.CreateDirectory(resultDir);
Expand Down Expand Up @@ -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();
Expand Down
54 changes: 50 additions & 4 deletions saveFileForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions saveFileForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down

0 comments on commit 0bd24e8

Please sign in to comment.