- 키워드 검색, 종목 찾기 추가

- 거부종목, 중복종목, 수동종목 추가
This commit is contained in:
2016-12-01 08:54:33 +09:00
parent 3b8b8dc4e7
commit af820d1f2c
15 changed files with 1730 additions and 84 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

219
CodeList.cs Normal file
View File

@@ -0,0 +1,219 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
namespace NewsCrawler
{
public class CodeList
{
public enum CODE_TYPE
{
NONE = 0,
ORIGINAL = NONE,
DENIAL = 1<<0,
DUPLICATED = 1<<1,
MANUAL = 1<<2,
}
public class CODE_VALUE
{
public CODE_TYPE m_enType;
public string m_strCode;
public string m_strName;
override public string ToString()
{
return string.Format("{0}:{1} ({2})", m_strCode, m_strName, m_enType);
}
}
class SYNONYM_VALUE
{
public string m_strCode;
public string m_strName;
}
CPUTILLib.CpStockCode m_StockCode = new CPUTILLib.CpStockCode();
List<CODE_VALUE> m_CodeList = new List<CODE_VALUE>();
List<SYNONYM_VALUE> m_SynonymList = new List<SYNONYM_VALUE>();
public CodeList()
{
MakeList();
LoadManualList();
LoadDenialList();
LoadDuplicatedList();
LoadSynonym();
Test();
}
void Test()
{
if(Util.IsDebugging() == false)
return;
SearchCode("[클릭 e종목]로엔, 본격적으로 시작되는 카카오 시너");
SearchCode("[클릭 e종목]\"SK텔레콤, 투자심리 개선 가능성 주목해");
SearchCode("[클릭 e종목]SK하이닉스, 추가 상승 낙관적");
SearchCode("MBK, 45억 규모 유상증자 결정");
SearchCode("다음주 코스피 1960~1990…산유량 감산여부에 주목");
}
void MakeList()
{
int iCnt = m_StockCode.GetCount();
for(short i = 0; i<iCnt; i++)
{
CODE_VALUE Code = new CODE_VALUE();
Code.m_enType = CODE_TYPE.ORIGINAL;
Code.m_strCode = m_StockCode.GetData(0, i);
Code.m_strName = m_StockCode.GetData(1, i);
if(Code.m_strCode[0] == 'A')
m_CodeList.Add(Code);
}
}
void LoadCodeType(string strPath, CODE_TYPE enType)
{
m_CodeList.ForEach(a => a.m_enType &= ~enType);
if(File.Exists(strPath) == false)
return;
string[] aLines = File.ReadAllLines(strPath);
foreach(string strLine in aLines)
{
if(strLine.Trim().Length <= 0)
continue;
CODE_VALUE code = m_CodeList.Find(s => s.m_strName == strLine.Trim());
if(code == null)
{
Util.Log(Util.LOG_TYPE.ERROR, string.Format("[code-{0}] 존재하지 않는 기업명입니다. ({1})", enType.ToString().ToLower(), strLine));
continue;
}
code.m_enType |= enType;
}
}
public void LoadManualList()
{
string strPath = Util.GetConfigPath()+"/code-manual.txt";
LoadCodeType(strPath, CODE_TYPE.MANUAL);
}
public void LoadDenialList()
{
string strPath = Util.GetConfigPath()+"/code-deny.txt";
LoadCodeType(strPath, CODE_TYPE.DENIAL);
}
public void LoadDuplicatedList()
{
string strPath = Util.GetConfigPath()+"/code-duplicated.txt";
LoadCodeType(strPath, CODE_TYPE.DUPLICATED);
}
public void MakeManualList(int iPrice)
{
m_CodeList.ForEach(a => a.m_enType &= ~CODE_TYPE.MANUAL);
List<string> ReqList = new List<string>();
int iCnt = 0;
string strCodes = "";
foreach(CODE_VALUE code in m_CodeList)
{
if(code.m_enType == CODE_TYPE.ORIGINAL)
{
strCodes += code.m_strCode;
iCnt++;
}
if(iCnt >= 110)
{
ReqList.Add(strCodes);
strCodes = "";
iCnt=0;
}
}
if(iCnt > 0)
{
ReqList.Add(strCodes);
strCodes = "";
iCnt=0;
}
DSCBO1Lib.StockMstm stockMstM = new DSCBO1Lib.StockMstm();
foreach(string codelist in ReqList)
{
stockMstM.SetInputValue(0, codelist);
stockMstM.BlockRequest2(0);
int iReturnCnt = stockMstM.GetHeaderValue(0);
for(int i = 0; i<iReturnCnt; i++)
{
int iCurPrice = stockMstM.GetDataValue(4, i);
if(iCurPrice >= iPrice)
{
string strCode = stockMstM.GetDataValue(0, i);
m_CodeList.FindAll(s => s.m_strCode == strCode).ForEach(s => s.m_enType |= CODE_TYPE.MANUAL);
}
}
}
string strContents = "";
m_CodeList.FindAll(s => (s.m_enType & CODE_TYPE.MANUAL) == CODE_TYPE.MANUAL)
.ForEach(s => strContents += (s.m_strName+Environment.NewLine));
string strPath = Util.GetConfigPath() + "/code-manual.txt";
File.WriteAllText(strPath, strContents, new System.Text.UTF8Encoding(true));
}
public void LoadSynonym()
{
string strPath = Util.GetConfigPath() + "/code-synonym.txt";
if(File.Exists(strPath) == true)
{
string[] aLines = File.ReadAllLines(strPath);
foreach(string line in aLines)
{
string[] aTokens = line.Trim().Split('=');
if(aTokens != null && aTokens.Length == 2)
{
string strSysnonym = aTokens[0].Trim();
string strOrg = aTokens[1].Trim();
CODE_VALUE Result = m_CodeList.Find(s => s.m_strName==strOrg);
if(Result == null)
{
Util.Log(Util.LOG_TYPE.ERROR, string.Format("[code-synonym] 존재하지 않는 기업명입니다. ({0})", strOrg));
continue;
}
SYNONYM_VALUE Code = new SYNONYM_VALUE();
Code.m_strCode = Result.m_strCode;
Code.m_strName = strSysnonym;
m_SynonymList.Add(Code);
}
}
}
}
public CODE_VALUE SearchCode(string strText)
{
CODE_VALUE Result = m_CodeList.Find(s => strText.Contains(s.m_strName));
if(Result != null)
return Result;
SYNONYM_VALUE Synonym = m_SynonymList.Find(s => strText.Contains(s.m_strName));
if(Synonym == null)
return null;
return m_CodeList.Find(s => s.m_strCode == Synonym.m_strCode);
}
}
}

66
Config.cs Normal file
View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace NewsCrawler
{
static class Config
{
static Dictionary<string, string> m_Data = new Dictionary<string, string>();
public static void Init()
{
m_Data.Add("manual-price", "100000");
Load();
}
static void Load()
{
string strPath = Util.GetConfigPath()+"/config.ini";
if(File.Exists(strPath) == false)
return;
m_Data.Clear();
string[] aLines = File.ReadAllLines(strPath);
foreach(string strLine in aLines)
{
if(strLine.Trim().Length <= 0)
continue;
string[] aTokens = strLine.Trim().Split('=');
if(aTokens.Length < 2)
continue;
m_Data.Add(aTokens[0], aTokens[1]);
}
}
static void Save()
{
string strContents = "";
foreach(KeyValuePair<string, string> pair in m_Data)
strContents += pair.Key + "=" + pair.Value + Environment.NewLine;
string strPath = Util.GetConfigPath()+"/config.ini";
File.WriteAllText(strPath, strContents, new UTF8Encoding(true));
}
public static int GetManualPrice()
{
int iPrice;
int.TryParse(m_Data["manual-price"], out iPrice);
return iPrice;
}
public static void SetManualPrice(int iPrice)
{
m_Data["manual-price"] = iPrice.ToString();
Save();
}
}
}

394
ConfigForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,394 @@
namespace NewsCrawler
{
partial class ConfigForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tbVolume = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.btnPositiveEdit = new System.Windows.Forms.Button();
this.btnCodeManualMake = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnCodeManualEdit = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.btnSynonymApply = new System.Windows.Forms.Button();
this.btnSynonymEdit = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.btnPositiveApply = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.btnNegativeApply = new System.Windows.Forms.Button();
this.btnNegativeEdit = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.btnManualApply = new System.Windows.Forms.Button();
this.btnManualEdit = new System.Windows.Forms.Button();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.btnDenialCodeApply = new System.Windows.Forms.Button();
this.btnDenialCodeEdit = new System.Windows.Forms.Button();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.btnDuplicatedCodeApply = new System.Windows.Forms.Button();
this.btnDuplicatedCodeEdit = new System.Windows.Forms.Button();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox6.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox8.SuspendLayout();
this.groupBox9.SuspendLayout();
this.SuspendLayout();
//
// tbVolume
//
this.tbVolume.Location = new System.Drawing.Point(61, 20);
this.tbVolume.Name = "tbVolume";
this.tbVolume.Size = new System.Drawing.Size(107, 21);
this.tbVolume.TabIndex = 1;
this.tbVolume.Text = "100000";
this.tbVolume.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 23);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 2;
this.label2.Text = "현재가";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(174, 23);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(45, 12);
this.label3.TabIndex = 3;
this.label3.Text = "원 이상";
//
// btnPositiveEdit
//
this.btnPositiveEdit.Location = new System.Drawing.Point(8, 14);
this.btnPositiveEdit.Name = "btnPositiveEdit";
this.btnPositiveEdit.Size = new System.Drawing.Size(72, 39);
this.btnPositiveEdit.TabIndex = 4;
this.btnPositiveEdit.Text = "편집";
this.btnPositiveEdit.UseVisualStyleBackColor = true;
this.btnPositiveEdit.Click += new System.EventHandler(this.btnPositiveEdit_Click);
//
// btnCodeManualMake
//
this.btnCodeManualMake.Location = new System.Drawing.Point(52, 47);
this.btnCodeManualMake.Name = "btnCodeManualMake";
this.btnCodeManualMake.Size = new System.Drawing.Size(93, 23);
this.btnCodeManualMake.TabIndex = 8;
this.btnCodeManualMake.Text = "수동 종목 생성";
this.btnCodeManualMake.UseVisualStyleBackColor = true;
this.btnCodeManualMake.Click += new System.EventHandler(this.btnCodeManualMake_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnCodeManualEdit);
this.groupBox1.Controls.Add(this.btnCodeManualMake);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.tbVolume);
this.groupBox1.Location = new System.Drawing.Point(10, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(262, 83);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "수동 종목";
//
// btnCodeManualEdit
//
this.btnCodeManualEdit.Location = new System.Drawing.Point(151, 47);
this.btnCodeManualEdit.Name = "btnCodeManualEdit";
this.btnCodeManualEdit.Size = new System.Drawing.Size(51, 23);
this.btnCodeManualEdit.TabIndex = 8;
this.btnCodeManualEdit.Text = "보기";
this.btnCodeManualEdit.UseVisualStyleBackColor = true;
this.btnCodeManualEdit.Click += new System.EventHandler(this.btnCodeManualEdit_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.groupBox6);
this.groupBox2.Controls.Add(this.groupBox3);
this.groupBox2.Controls.Add(this.groupBox5);
this.groupBox2.Controls.Add(this.groupBox4);
this.groupBox2.Location = new System.Drawing.Point(280, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(262, 287);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "키워드";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.btnSynonymApply);
this.groupBox6.Controls.Add(this.btnSynonymEdit);
this.groupBox6.Location = new System.Drawing.Point(44, 212);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(165, 58);
this.groupBox6.TabIndex = 12;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "기업 동의어";
//
// btnSynonymApply
//
this.btnSynonymApply.Location = new System.Drawing.Point(86, 14);
this.btnSynonymApply.Name = "btnSynonymApply";
this.btnSynonymApply.Size = new System.Drawing.Size(72, 39);
this.btnSynonymApply.TabIndex = 4;
this.btnSynonymApply.Text = "적용";
this.btnSynonymApply.UseVisualStyleBackColor = true;
this.btnSynonymApply.Click += new System.EventHandler(this.btnSynonymApply_Click);
//
// btnSynonymEdit
//
this.btnSynonymEdit.Location = new System.Drawing.Point(8, 14);
this.btnSynonymEdit.Name = "btnSynonymEdit";
this.btnSynonymEdit.Size = new System.Drawing.Size(72, 39);
this.btnSynonymEdit.TabIndex = 4;
this.btnSynonymEdit.Text = "편집";
this.btnSynonymEdit.UseVisualStyleBackColor = true;
this.btnSynonymEdit.Click += new System.EventHandler(this.btnSynonymEdit_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.btnPositiveApply);
this.groupBox3.Controls.Add(this.btnPositiveEdit);
this.groupBox3.Location = new System.Drawing.Point(44, 20);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(165, 58);
this.groupBox3.TabIndex = 11;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "긍정문구";
//
// btnPositiveApply
//
this.btnPositiveApply.Location = new System.Drawing.Point(86, 14);
this.btnPositiveApply.Name = "btnPositiveApply";
this.btnPositiveApply.Size = new System.Drawing.Size(72, 39);
this.btnPositiveApply.TabIndex = 4;
this.btnPositiveApply.Text = "적용";
this.btnPositiveApply.UseVisualStyleBackColor = true;
this.btnPositiveApply.Click += new System.EventHandler(this.btnPositiveApply_Click);
//
// groupBox5
//
this.groupBox5.Controls.Add(this.btnNegativeApply);
this.groupBox5.Controls.Add(this.btnNegativeEdit);
this.groupBox5.Location = new System.Drawing.Point(44, 148);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(165, 58);
this.groupBox5.TabIndex = 12;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "부정문구";
//
// btnNegativeApply
//
this.btnNegativeApply.Location = new System.Drawing.Point(86, 14);
this.btnNegativeApply.Name = "btnNegativeApply";
this.btnNegativeApply.Size = new System.Drawing.Size(72, 39);
this.btnNegativeApply.TabIndex = 4;
this.btnNegativeApply.Text = "적용";
this.btnNegativeApply.UseVisualStyleBackColor = true;
this.btnNegativeApply.Click += new System.EventHandler(this.btnNegativeApply_Click);
//
// btnNegativeEdit
//
this.btnNegativeEdit.Location = new System.Drawing.Point(8, 14);
this.btnNegativeEdit.Name = "btnNegativeEdit";
this.btnNegativeEdit.Size = new System.Drawing.Size(72, 39);
this.btnNegativeEdit.TabIndex = 4;
this.btnNegativeEdit.Text = "편집";
this.btnNegativeEdit.UseVisualStyleBackColor = true;
this.btnNegativeEdit.Click += new System.EventHandler(this.btnNegativeEdit_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.btnManualApply);
this.groupBox4.Controls.Add(this.btnManualEdit);
this.groupBox4.Location = new System.Drawing.Point(44, 84);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(165, 58);
this.groupBox4.TabIndex = 12;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "수동문구";
//
// btnManualApply
//
this.btnManualApply.Location = new System.Drawing.Point(86, 14);
this.btnManualApply.Name = "btnManualApply";
this.btnManualApply.Size = new System.Drawing.Size(72, 39);
this.btnManualApply.TabIndex = 4;
this.btnManualApply.Text = "적용";
this.btnManualApply.UseVisualStyleBackColor = true;
this.btnManualApply.Click += new System.EventHandler(this.btnManualApply_Click);
//
// btnManualEdit
//
this.btnManualEdit.Location = new System.Drawing.Point(8, 14);
this.btnManualEdit.Name = "btnManualEdit";
this.btnManualEdit.Size = new System.Drawing.Size(72, 39);
this.btnManualEdit.TabIndex = 4;
this.btnManualEdit.Text = "편집";
this.btnManualEdit.UseVisualStyleBackColor = true;
this.btnManualEdit.Click += new System.EventHandler(this.btnManualEdit_Click);
//
// groupBox7
//
this.groupBox7.Controls.Add(this.btnDenialCodeApply);
this.groupBox7.Controls.Add(this.btnDenialCodeEdit);
this.groupBox7.Location = new System.Drawing.Point(59, 20);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(165, 58);
this.groupBox7.TabIndex = 12;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "거부종목";
//
// btnDenialCodeApply
//
this.btnDenialCodeApply.Location = new System.Drawing.Point(86, 14);
this.btnDenialCodeApply.Name = "btnDenialCodeApply";
this.btnDenialCodeApply.Size = new System.Drawing.Size(72, 39);
this.btnDenialCodeApply.TabIndex = 4;
this.btnDenialCodeApply.Text = "적용";
this.btnDenialCodeApply.UseVisualStyleBackColor = true;
this.btnDenialCodeApply.Click += new System.EventHandler(this.btnDenialCodeApply_Click);
//
// btnDenialCodeEdit
//
this.btnDenialCodeEdit.Location = new System.Drawing.Point(8, 14);
this.btnDenialCodeEdit.Name = "btnDenialCodeEdit";
this.btnDenialCodeEdit.Size = new System.Drawing.Size(72, 39);
this.btnDenialCodeEdit.TabIndex = 4;
this.btnDenialCodeEdit.Text = "편집";
this.btnDenialCodeEdit.UseVisualStyleBackColor = true;
this.btnDenialCodeEdit.Click += new System.EventHandler(this.btnDenialCodeEdit_Click);
//
// groupBox8
//
this.groupBox8.Controls.Add(this.btnDuplicatedCodeApply);
this.groupBox8.Controls.Add(this.btnDuplicatedCodeEdit);
this.groupBox8.Location = new System.Drawing.Point(59, 89);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(165, 58);
this.groupBox8.TabIndex = 12;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "중복종목";
//
// btnDuplicatedCodeApply
//
this.btnDuplicatedCodeApply.Location = new System.Drawing.Point(86, 14);
this.btnDuplicatedCodeApply.Name = "btnDuplicatedCodeApply";
this.btnDuplicatedCodeApply.Size = new System.Drawing.Size(72, 39);
this.btnDuplicatedCodeApply.TabIndex = 4;
this.btnDuplicatedCodeApply.Text = "적용";
this.btnDuplicatedCodeApply.UseVisualStyleBackColor = true;
this.btnDuplicatedCodeApply.Click += new System.EventHandler(this.btnDuplicatedCodeApply_Click);
//
// btnDuplicatedCodeEdit
//
this.btnDuplicatedCodeEdit.Location = new System.Drawing.Point(8, 14);
this.btnDuplicatedCodeEdit.Name = "btnDuplicatedCodeEdit";
this.btnDuplicatedCodeEdit.Size = new System.Drawing.Size(72, 39);
this.btnDuplicatedCodeEdit.TabIndex = 4;
this.btnDuplicatedCodeEdit.Text = "편집";
this.btnDuplicatedCodeEdit.UseVisualStyleBackColor = true;
this.btnDuplicatedCodeEdit.Click += new System.EventHandler(this.btnDuplicatedCodeEdit_Click);
//
// groupBox9
//
this.groupBox9.Controls.Add(this.groupBox8);
this.groupBox9.Controls.Add(this.groupBox7);
this.groupBox9.Location = new System.Drawing.Point(10, 101);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(262, 157);
this.groupBox9.TabIndex = 10;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "종목편집";
//
// ConfigForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 307);
this.Controls.Add(this.groupBox9);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "ConfigForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "설정";
this.Load += new System.EventHandler(this.ConfigForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox7.ResumeLayout(false);
this.groupBox8.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TextBox tbVolume;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnPositiveEdit;
private System.Windows.Forms.Button btnCodeManualMake;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Button btnSynonymApply;
private System.Windows.Forms.Button btnSynonymEdit;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button btnPositiveApply;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button btnNegativeApply;
private System.Windows.Forms.Button btnNegativeEdit;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Button btnManualApply;
private System.Windows.Forms.Button btnManualEdit;
private System.Windows.Forms.Button btnCodeManualEdit;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.Button btnDenialCodeApply;
private System.Windows.Forms.Button btnDenialCodeEdit;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Button btnDuplicatedCodeApply;
private System.Windows.Forms.Button btnDuplicatedCodeEdit;
private System.Windows.Forms.GroupBox groupBox9;
}
}

113
ConfigForm.cs Normal file
View File

@@ -0,0 +1,113 @@
using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace NewsCrawler
{
public partial class ConfigForm : Form
{
NewsForm m_Listener = null;
public ConfigForm(NewsForm Listener)
{
m_Listener = Listener;
InitializeComponent();
}
private void ConfigForm_Load(object sender, EventArgs e)
{
tbVolume.Text = Config.GetManualPrice().ToString();
}
private void OpenFile(string strName)
{
string strPath = Util.GetConfigPath()+strName;
if(File.Exists(strPath) == false)
{
using(var sw = new StreamWriter(File.Open(strPath, FileMode.CreateNew), new UTF8Encoding(true)))
sw.WriteLine("");
}
System.Diagnostics.Process.Start(strPath);
}
#region codes
private void btnCodeManualMake_Click(object sender, EventArgs e)
{
int iPrice;
int.TryParse(tbVolume.Text, out iPrice);
Config.SetManualPrice(iPrice);
m_Listener.OnManualCodeClick(iPrice);
}
private void btnCodeManualEdit_Click(object sender, EventArgs e)
{
OpenFile("/code-manual.txt");
}
private void btnDenialCodeEdit_Click(object sender, EventArgs e)
{
OpenFile("/code-deny.txt");
}
private void btnDenialCodeApply_Click(object sender, EventArgs e)
{
m_Listener.ApplyDenialCode();
}
private void btnDuplicatedCodeEdit_Click(object sender, EventArgs e)
{
OpenFile("/code-duplicated.txt");
}
private void btnDuplicatedCodeApply_Click(object sender, EventArgs e)
{
m_Listener.ApplyDuplicatedCode();
}
#endregion
#region Keywords
private void btnPositiveEdit_Click(object sender, EventArgs e)
{
OpenFile("/keyword-positive.txt");
}
private void btnPositiveApply_Click(object sender, EventArgs e)
{
m_Listener.ApplyPositive();
}
private void btnManualEdit_Click(object sender, EventArgs e)
{
OpenFile("/keyword-manual.txt");
}
private void btnManualApply_Click(object sender, EventArgs e)
{
m_Listener.ApplyManual();
}
private void btnNegativeEdit_Click(object sender, EventArgs e)
{
OpenFile("/keyword-negative.txt");
}
private void btnNegativeApply_Click(object sender, EventArgs e)
{
m_Listener.ApplyNegative();
}
private void btnSynonymEdit_Click(object sender, EventArgs e)
{
OpenFile("/code-synonym.txt");
}
private void btnSynonymApply_Click(object sender, EventArgs e)
{
m_Listener.ApplySynonym();
}
#endregion
}
}

37
CybosHelper.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewsCrawler
{
public class CybosHelper
{
CPUTILLib.CpCybos m_CPUtil = new CPUTILLib.CpCybos();
public CybosHelper()
{
}
public int GetLimitRemainCountTrace()
{
return m_CPUtil.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_TRADE_REQUEST);
}
public int GetLimitRemainCountRQ()
{
return m_CPUtil.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_NONTRADE_REQUEST);
}
public int GetLimitRemainCountSB()
{
return m_CPUtil.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_SUBSCRIBE);
}
public bool IsConnected()
{
return (m_CPUtil.IsConnect==1);
}
}
}

View File

@@ -12,6 +12,22 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>0.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,12 +48,32 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>3313DBEFFBEC4C1DB9EB9C32C7AE16B7932B4A65</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>NewsCrawler_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<ItemGroup>
<Reference Include="HtmlAgilityPack">
<HintPath>HtmlAgility\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -49,16 +85,30 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="CodeList.cs" />
<Compile Include="Config.cs" />
<Compile Include="ConfigForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="ConfigForm.Designer.cs">
<DependentUpon>ConfigForm.cs</DependentUpon>
</Compile>
<Compile Include="CybosHelper.cs" />
<Compile Include="NewsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewsForm.Designer.cs">
<DependentUpon>NewsForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="TextCondition.cs" />
<Compile Include="Util.cs" />
<EmbeddedResource Include="ConfigForm.resx">
<DependentUpon>ConfigForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewsForm.resx">
<DependentUpon>NewsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@@ -69,6 +119,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -82,6 +133,83 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<COMReference Include="CPFOREDIBLIB">
<Guid>{ABA39D6F-5AF4-4D10-8389-031055C13A75}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPFORETRADELib">
<Guid>{1E3BC2CB-4AC7-46BB-AF63-11DEA8628E3C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CpIndexesLib">
<Guid>{3DC4496B-C823-4440-ABD4-A248A716F7C6}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPSYSDIBLib">
<Guid>{9C31B76A-7189-49A3-9781-3C6DD6ED5AD3}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPTRADELib">
<Guid>{1F7D5E5A-05AB-4236-B6F3-3D383B09203A}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPUTILLib">
<Guid>{2DA9C35C-FE59-4A32-A942-325EE8A6F659}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="DSCBO1Lib">
<Guid>{859343F1-08FD-11D4-8231-00105A7C4F8C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1,6 +1,6 @@
namespace NewsCrawler
{
partial class Form1
partial class NewsForm
{
/// <summary>
/// Required designer variable.
@@ -41,10 +41,17 @@
this.chAutoSelect = new System.Windows.Forms.CheckBox();
this.tbInterval = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.btnConfig = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.tbLog = new System.Windows.Forms.RichTextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// lvList
@@ -63,7 +70,7 @@
this.lvList.Location = new System.Drawing.Point(0, 0);
this.lvList.MultiSelect = false;
this.lvList.Name = "lvList";
this.lvList.Size = new System.Drawing.Size(864, 157);
this.lvList.Size = new System.Drawing.Size(862, 123);
this.lvList.TabIndex = 0;
this.lvList.UseCompatibleStateImageBehavior = false;
this.lvList.View = System.Windows.Forms.View.Details;
@@ -103,15 +110,13 @@
this.wbView.Location = new System.Drawing.Point(0, 0);
this.wbView.MinimumSize = new System.Drawing.Size(20, 20);
this.wbView.Name = "wbView";
this.wbView.Size = new System.Drawing.Size(864, 644);
this.wbView.Size = new System.Drawing.Size(862, 507);
this.wbView.TabIndex = 1;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@@ -122,8 +127,8 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.wbView);
this.splitContainer1.Size = new System.Drawing.Size(864, 805);
this.splitContainer1.SplitterDistance = 157;
this.splitContainer1.Size = new System.Drawing.Size(862, 634);
this.splitContainer1.SplitterDistance = 123;
this.splitContainer1.TabIndex = 2;
//
// chAutoReload
@@ -169,22 +174,71 @@
this.label1.TabIndex = 6;
this.label1.Text = "갱신주기";
//
// Form1
// btnConfig
//
this.btnConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnConfig.Location = new System.Drawing.Point(788, 1);
this.btnConfig.Name = "btnConfig";
this.btnConfig.Size = new System.Drawing.Size(75, 23);
this.btnConfig.TabIndex = 7;
this.btnConfig.Text = "설정";
this.btnConfig.UseVisualStyleBackColor = true;
this.btnConfig.Click += new System.EventHandler(this.btnConfig_Click);
//
// splitContainer2
//
this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer2.Location = new System.Drawing.Point(1, 26);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.tbLog);
this.splitContainer2.Size = new System.Drawing.Size(862, 803);
this.splitContainer2.SplitterDistance = 634;
this.splitContainer2.TabIndex = 8;
//
// tbLog
//
this.tbLog.BackColor = System.Drawing.SystemColors.Window;
this.tbLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbLog.Location = new System.Drawing.Point(0, 0);
this.tbLog.Name = "tbLog";
this.tbLog.ReadOnly = true;
this.tbLog.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.tbLog.Size = new System.Drawing.Size(862, 165);
this.tbLog.TabIndex = 0;
this.tbLog.Text = "";
//
// NewsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(864, 829);
this.Controls.Add(this.splitContainer2);
this.Controls.Add(this.btnConfig);
this.Controls.Add(this.label1);
this.Controls.Add(this.tbInterval);
this.Controls.Add(this.chAutoSelect);
this.Controls.Add(this.chAutoReload);
this.Controls.Add(this.splitContainer1);
this.Name = "Form1";
this.Name = "NewsForm";
this.Text = "News Crawler";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewsForm_FormClosing);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -205,6 +259,9 @@
private System.Windows.Forms.CheckBox chAutoSelect;
private System.Windows.Forms.TextBox tbInterval;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnConfig;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.RichTextBox tbLog;
}
}

View File

@@ -15,22 +15,38 @@ using System.Windows.Forms;
namespace NewsCrawler
{
public partial class Form1 : Form
public partial class NewsForm : Form
{
delegate void InsertListView(bool bInitial, string strTitle, DateTime time, string strURL, string strRef);
CybosHelper m_CybosHelper = new CybosHelper();
CodeList m_CodeList = null;
TextCondition m_Condition = null;
ConfigForm m_ConfigForm = null;
delegate void InsertListView(string strTitle, DateTime time, string strURL, string strRef, bool bInitial);
System.Timers.Timer m_CrawlTimer = new System.Timers.Timer();
int m_iCrawlInterval = 500;
public Form1()
public NewsForm()
{
InitializeComponent();
Config.Init();
Util.SetLogView(tbLog);
m_ConfigForm = new ConfigForm(this);
m_CodeList = new CodeList();
m_Condition = new TextCondition();
wbView.ScriptErrorsSuppressed = false;
ReadKIND(true);
ReadDart(true);
ReadAsiaE(true);
ReadEtoday(true);
ReadAsiaE(true);
lvList.ListViewItemSorter = new ListViewItemComparer(0, SortOrder.Ascending);
lvList.Sorting = SortOrder.Ascending;
@@ -44,57 +60,99 @@ namespace NewsCrawler
lvList.SelectedItems[0].EnsureVisible();
}
m_CrawlTimer.Elapsed+=CrawlTimer_Tick;
m_CrawlTimer.Interval=m_iCrawlInterval;
m_CrawlTimer.Start();
Test();
}
private void InsertItem(bool bInitial, string strTitle, DateTime time, string strURL, string strRef)
void Test()
{
if(strTitle == "")
Console.WriteLine("break");
if(Util.IsDebugging() == false)
return;
InsertItem("덕산하이메탈, 덕산네오룩스 66만여주 취득14:38", new DateTime(2016, 11, 30, 14, 38, 00), "http://www.asiae.co.kr/news/sokbo/sokbo_view.htm?idxno=2016112914371817318", "asiae", false);
InsertItem("자연과환경, 12월15일~22일 주주명부폐쇄14:19", new DateTime(2016, 11, 30, 14, 19, 00), "http://www.asiae.co.kr/news/sokbo/sokbo_view.htm?idxno=2016112914193170301", "asiae", false);
InsertItem("이엠코리아, 한국항공우주산업과 3억원 규모 공급계약14:06", new DateTime(2016, 11, 30, 14, 06, 00), "http://www.asiae.co.kr/news/sokbo/sokbo_view.htm?idxno=2016112914055964082", "asiae", false);
}
void ProcessSearchAndBuy(string strTitle, string strRef)
{
CodeList.CODE_VALUE Code = m_CodeList.SearchCode(strTitle);
if(Code != null)
{
TextCondition.RESULT MatchResult = m_Condition.Match(strTitle);
switch(MatchResult.m_enType)
{
case TextCondition.TYPE.NEGATIVE:
Util.Log(Util.LOG_TYPE.NEGATIVE, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
break;
case TextCondition.TYPE.POSITIVE:
if((Code.m_enType&CodeList.CODE_TYPE.DENIAL) == CodeList.CODE_TYPE.DENIAL)
Util.Log(Util.LOG_TYPE.DENIAL, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
else if((Code.m_enType&CodeList.CODE_TYPE.DENIAL) == CodeList.CODE_TYPE.DUPLICATED)
Util.Log(Util.LOG_TYPE.DUPLICATED, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
else if((Code.m_enType&CodeList.CODE_TYPE.DENIAL) == CodeList.CODE_TYPE.MANUAL)
Util.Log(Util.LOG_TYPE.MANUAL_CODE, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
else
Util.Log(Util.LOG_TYPE.POSITIVE, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
break;
case TextCondition.TYPE.MANUAL:
Util.Log(Util.LOG_TYPE.MANUAL_KEYWORD, string.Format("[{0}] {1} (keyword:{2}, code:{3})", strRef, strTitle, MatchResult.m_strKeyword, Code.ToString()));
break;
case TextCondition.TYPE.NOT_MATCHED:
Util.Log(Util.LOG_TYPE.DEBUG, string.Format("[NOT_MATCHED] [{0}] {1}({2})", strRef, strTitle, Code.ToString()));
break;
}
}
}
private void InsertItem(string strTitle, DateTime time, string strURL, string strRef, bool bInitial)
{
try
{
if(this.InvokeRequired)
{
this.Invoke(new InsertListView(InsertItem), bInitial, strTitle, time, strURL, strRef);
this.Invoke(new InsertListView(InsertItem), strTitle, time, strURL, strRef, bInitial);
}
else
{
//lock(lvList)
foreach(ListViewItem item in lvList.Items)
{
foreach(ListViewItem item in lvList.Items)
{
if(item.SubItems[chLink.Index].Text == strURL)
return;
}
if(item.SubItems[chLink.Index].Text == strURL)
return;
}
lvList.Items.Add(new ListViewItem(new string[] { time.ToString("HH:mm:ss"), strTitle, "", "", strRef, strURL }));
lvList.Items.Add(new ListViewItem(new string[] { time.ToString("HH:mm:ss"), strTitle, "", "", strRef, strURL }));
if(chAutoSelect.Checked == true)
{
lvList.Items[lvList.Items.Count - 1].Selected = true;
lvList.Select();
if(lvList.SelectedItems.Count > 0)
lvList.SelectedItems[0].EnsureVisible();
}
if(chAutoSelect.Checked == true)
{
lvList.Items[lvList.Items.Count - 1].Selected = true;
lvList.Select();
if(lvList.SelectedItems.Count > 0)
lvList.SelectedItems[0].EnsureVisible();
}
if(bInitial == false)
{
lvList.Sort();
}
foreach(ColumnHeader col in lvList.Columns)
col.Width = -2;
foreach(ColumnHeader col in lvList.Columns)
col.Width = -2;
if(bInitial == false)
{
lvList.Sort();
ProcessSearchAndBuy(strTitle, strRef);
}
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
Util.Log(Util.LOG_TYPE.ERROR, ex.Message);
}
}
@@ -124,7 +182,9 @@ namespace NewsCrawler
var lists = doc.DocumentNode.SelectNodes(strXPath);
foreach(var item in lists)
{
string strTitle = item.SelectSingleNode(".//a").GetAttributeValue("title", "");
string strTitle1 = item.SelectSingleNode(".//a").GetAttributeValue("title", "");
string strTitle2 = item.SelectSingleNode(".//a").FirstChild.InnerText;
string strTitle = (strTitle1.Length > strTitle2.Length ? strTitle1 : strTitle2);
string strTime = item.SelectSingleNode(".//span").InnerText;
string strURL = strServerURL+item.SelectSingleNode(".//a").GetAttributeValue("href", "");
@@ -135,7 +195,7 @@ namespace NewsCrawler
continue;
}
InsertItem(bInitial, strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "아시아경제");
InsertItem(strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "아시아경제", bInitial);
}
}
@@ -144,7 +204,7 @@ namespace NewsCrawler
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
}
return bHasNew;
@@ -186,7 +246,7 @@ namespace NewsCrawler
continue;
}
InsertItem(bInitial, strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "이투데이");
InsertItem(strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "이투데이", bInitial);
}
}
}
@@ -194,20 +254,20 @@ namespace NewsCrawler
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
}
return bHasNew;
}
bool ReadDart(bool bInitial=false)
bool ReadDart(bool bInitial = false)
{
bool bHasNew = false;
try
{
string strServerURL = "https://dart.fss.or.kr";
WebRequest request = WebRequest.Create("https://dart.fss.or.kr/dsac001/mainAll.do");
string strServerURL = "https://dart.fss.or.kr";
WebRequest request = WebRequest.Create("https://dart.fss.or.kr/dsac001/mainAll.do");
request.Credentials=CredentialCache.DefaultCredentials;
request.Timeout=2000;
@@ -224,41 +284,41 @@ namespace NewsCrawler
string strXPath = "//div[@id='listContents']/div[contains(@class, 'table_list')]/table/tr";
var lists = doc.DocumentNode.SelectNodes(strXPath);
foreach(var item in lists)
{
var rows = item.SelectNodes(".//td");
foreach(var item in lists)
{
var rows = item.SelectNodes(".//td");
if(rows.Count < 3)
continue;
string strTitle = rows[2].InnerText;
strTitle=strTitle.Trim();
string strTime = item.SelectSingleNode(".//td[contains(@class, 'cen_txt')]").InnerText;
strTime=strTime.Trim();
string strURL = rows[2].SelectSingleNode(".//a").GetAttributeValue("href", "");
strURL=strURL.Trim();
strURL =strServerURL+strURL;
string strTitle = rows[2].InnerText;
strTitle=strTitle.Trim();
string strTime = item.SelectSingleNode(".//td[contains(@class, 'cen_txt')]").InnerText;
strTime=strTime.Trim();
string strURL = rows[2].SelectSingleNode(".//a").GetAttributeValue("href", "");
strURL=strURL.Trim();
strURL =strServerURL+strURL;
if(Regex.IsMatch(strTime, @"\d+/\d+")==true)
{
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
continue;
}
if(Regex.IsMatch(strTime, @"\d+/\d+")==true)
{
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
continue;
}
InsertItem(bInitial, strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "DART");
InsertItem(strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "DART", bInitial);
}
}
}
}
}
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
}
return bHasNew;
}
bool ReadKIND(bool bInitial=false)
bool ReadKIND(bool bInitial = false)
{
bool bHasNew = false;
@@ -285,7 +345,7 @@ namespace NewsCrawler
var lists = doc.DocumentNode.SelectNodes(strXPath);
if(lists == null)
return false;
foreach(var item in lists)
{
string strTitle = item.SelectSingleNode(".//title").InnerText;
@@ -302,7 +362,7 @@ namespace NewsCrawler
continue;
}
InsertItem(bInitial, strTitle, DateTime.ParseExact(strTime, "HH:mm", CultureInfo.CurrentCulture), strURL, "KIND");
InsertItem(strTitle, DateTime.ParseExact(strTime, "HH:mm:ss", CultureInfo.CurrentCulture), strURL, "KIND", bInitial);
}
}
}
@@ -310,7 +370,7 @@ namespace NewsCrawler
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
}
return bHasNew;
@@ -334,7 +394,7 @@ namespace NewsCrawler
private void lvList_SelectedIndexChanged(object sender, EventArgs e)
{
if (lvList.SelectedItems.Count <= 0)
if(lvList.SelectedItems.Count <= 0)
return;
string strURL = lvList.SelectedItems[0].SubItems[chLink.Index].Text;
@@ -347,7 +407,7 @@ namespace NewsCrawler
if(e.KeyChar == Convert.ToChar(Keys.Enter))
{
m_iCrawlInterval = (int)(float.Parse(Regex.Replace(tbInterval.Text, @"\D\.", "")) * 1000);
if (m_iCrawlInterval < 1)
if(m_iCrawlInterval < 1)
m_iCrawlInterval = 500;
tbInterval.Text = (m_iCrawlInterval / (float)1000).ToString("##0.0") + "초";
@@ -362,6 +422,68 @@ namespace NewsCrawler
lvList.Sorting = Order;
lvList.Sort();
}
private void btnConfig_Click(object sender, EventArgs e)
{
FormCollection OpenForms = Application.OpenForms;
bool bOpen = false;
foreach(Form form in OpenForms)
{
if(form == m_ConfigForm)
{
bOpen = true;
break;
}
}
if(bOpen == false)
{
m_ConfigForm.Show();
}
else
{
m_ConfigForm.BringToFront();
}
}
public void OnManualCodeClick(int iPrice)
{
m_CodeList.MakeManualList(iPrice);
}
public void ApplyDenialCode()
{
m_CodeList.LoadDenialList();
}
public void ApplyDuplicatedCode()
{
m_CodeList.LoadDuplicatedList();
}
public void ApplyPositive()
{
m_Condition.LoadPositive();
}
public void ApplyManual()
{
m_Condition.LoadManual();
}
public void ApplyNegative()
{
m_Condition.LoadNegative();
}
public void ApplySynonym()
{
m_CodeList.LoadSynonym();
}
private void NewsForm_FormClosing(object sender, FormClosingEventArgs e)
{
Util.Clear();
}
}

120
NewsForm.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -16,7 +16,7 @@ namespace NewsCrawler
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new NewsForm());
}
}
}

174
TextCondition.cs Normal file
View File

@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace NewsCrawler
{
public class TextCondition
{
public enum TYPE
{
NOT_MATCHED,
NEGATIVE,
POSITIVE,
MANUAL
}
List<Regex> m_Positive = new List<Regex>();
List<Regex> m_Negative = new List<Regex>();
List<Regex> m_Manual = new List<Regex>();
public TextCondition()
{
LoadAll();
Test();
}
void Test()
{
if(Util.IsDebugging() == false)
return;
Console.WriteLine(Match("다음 주가 상승 기대"));
Console.WriteLine(Match("네이버 파산 기대"));
Console.WriteLine(Match("김장철"));
Console.WriteLine(Match("15억"));
Console.WriteLine(Match("33억"));
Console.WriteLine(Match("846조"));
Console.WriteLine(Match("39조"));
Console.WriteLine(Match("48437조"));
Console.WriteLine(Match("1만"));
Console.WriteLine(Match("10만"));
Console.WriteLine(Match("100만"));
Console.WriteLine(Match("200만"));
Console.WriteLine(Match("500만"));
Console.WriteLine(Match("1000만"));
Console.WriteLine(Match("10000만"));
Console.WriteLine(Match("100000만"));
Console.WriteLine(Match("1000000만"));
Console.WriteLine("test end");
}
public void LoadPositive()
{
m_Positive.Clear();
string strPath = Util.GetConfigPath() + "/keyword-positive.txt";
if(File.Exists(strPath) == true)
{
string[] aLines = File.ReadAllLines(strPath);
foreach(string line in aLines)
{
if(line.Trim().Length == 0 || line[0] == '#')
continue;
try
{
m_Positive.Add(new Regex(line));
}
catch(ArgumentException ex)
{
Util.Log(Util.LOG_TYPE.ERROR, string.Format("[keyword-positive] 잘못된 키워드 ({0})", ex.Message));
}
}
}
}
public void LoadManual()
{
m_Manual.Clear();
string strPath = Util.GetConfigPath() + "/keyword-manual.txt";
if(File.Exists(strPath) == true)
{
string[] aLines = File.ReadAllLines(strPath);
foreach(string line in aLines)
{
if(line.Trim().Length == 0 || line[0] == '#')
continue;
try
{
m_Manual.Add(new Regex(line));
}
catch(ArgumentException ex)
{
Util.Log(Util.LOG_TYPE.ERROR, string.Format("[keyword-manual] 잘못된 키워드 ({0})", ex.Message));
}
}
}
}
public void LoadNegative()
{
m_Negative.Clear();
string strPath = Util.GetConfigPath() + "/keyword-negative.txt";
if(File.Exists(strPath) == true)
{
string[] aLines = File.ReadAllLines(strPath);
foreach(string line in aLines)
{
if(line.Trim().Length == 0 || line[0] == '#')
continue;
try
{
m_Negative.Add(new Regex(line));
}
catch(ArgumentException ex)
{
Util.Log(Util.LOG_TYPE.ERROR, string.Format("[keyword-negative] 잘못된 키워드 ({0})", ex.Message));
}
}
}
}
void LoadAll()
{
LoadPositive();
LoadNegative();
LoadManual();
}
public class RESULT
{
public TYPE m_enType;
public string m_strKeyword;
public RESULT(TYPE enType, string strKeyword)
{
m_enType = enType;
m_strKeyword = strKeyword;
}
public override string ToString()
{
return string.Format("[{0}] {1}", m_enType, m_strKeyword);
}
}
public RESULT Match(string strText)
{
Regex result = m_Negative.Find(s => s.IsMatch(strText));
if(result != null)
return new RESULT(TYPE.NEGATIVE, result.ToString());
result = m_Manual.Find(s => s.IsMatch(strText));
if(result != null)
return new RESULT(TYPE.MANUAL, result.ToString());
result = m_Positive.Find(s => s.IsMatch(strText));
if(result != null)
return new RESULT(TYPE.POSITIVE, result.ToString());
return new RESULT(TYPE.NOT_MATCHED, "");
}
}
}

146
Util.cs Normal file
View File

@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace NewsCrawler
{
static class Util
{
public enum LOG_TYPE
{
DEBUG,
ERROR,
VERVOSE,
NEGATIVE,
POSITIVE,
MANUAL_KEYWORD,
MANUAL_CODE,
DUPLICATED,
DENIAL,
BUY,
}
static string m_strLogFile = null;
static RichTextBox m_LogBox = null;
public static void SetLogView(RichTextBox logBox)
{
m_LogBox = logBox;
}
public static void Clear()
{
m_LogBox = null;
}
delegate void InsertLogDelegate(RichTextBox LogBox, LOG_TYPE enType, string strLog);
static void InsertLog(RichTextBox LogBox, LOG_TYPE enType, string strLog)
{
Form mainForm = (Application.OpenForms.Count > 0) ? Application.OpenForms[0] : null;
bool bInvoke = mainForm != null ? mainForm.InvokeRequired || LogBox.InvokeRequired : LogBox.InvokeRequired;
if(bInvoke)
{
mainForm.Invoke(new InsertLogDelegate(InsertLog), LogBox, enType, strLog);
}
else
{
Color LogColor;
switch(enType)
{
case LOG_TYPE.DEBUG:
LogColor = Color.Gray;
break;
case LOG_TYPE.ERROR:
LogColor = Color.DarkRed;
break;
case LOG_TYPE.VERVOSE:
LogColor = Color.Black;
break;
case LOG_TYPE.NEGATIVE:
case LOG_TYPE.DENIAL:
case LOG_TYPE.DUPLICATED:
LogColor = Color.Blue;
break;
case LOG_TYPE.POSITIVE:
case LOG_TYPE.MANUAL_KEYWORD:
case LOG_TYPE.BUY:
LogColor = Color.Red;
break;
default:
LogColor = Color.Black;
break;
}
LogBox.SelectionStart = LogBox.TextLength;
LogBox.SelectionLength = 0;
LogBox.SelectionColor = LogColor;
LogBox.AppendText(strLog);
LogBox.SelectionColor = LogBox.ForeColor;
LogBox.SelectionStart = LogBox.TextLength;
LogBox.ScrollToCaret();
}
}
public static void Log(LOG_TYPE enType, string strLog)
{
if(Directory.Exists(GetLogPath()) == false)
Directory.CreateDirectory(GetLogPath());
if(m_strLogFile == null)
{
string strToday = DateTime.Now.ToString("yyyy-MM-dd");
m_strLogFile = GetLogPath()+"/"+strToday+".txt";
}
string strLogLevel = "["+enType+"] ";
string strTime = DateTime.Now.ToString("[hh:mm:ss] ");
string strMessage = strTime+strLogLevel+strLog+Environment.NewLine;
File.AppendAllText(m_strLogFile, strMessage, new UTF8Encoding(true));
if(m_LogBox != null)
InsertLog(m_LogBox, enType, strMessage);
}
public static bool IsDebugging()
{
return Debugger.IsAttached;
}
public static string GetConfigPath()
{
string strPath = "";
if(IsDebugging())
strPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));
else
strPath = Directory.GetCurrentDirectory();
strPath += "/configure";
if(Directory.Exists(strPath) == false)
Directory.CreateDirectory(strPath);
return strPath;
}
public static string GetLogPath()
{
string strPath = "";
if(IsDebugging())
strPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));
else
strPath = Directory.GetCurrentDirectory();
strPath += "/log";
return strPath;
}
}
}

70
app.manifest Normal file
View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>