From d1eaebc402e0f0fdd6d5a11a377d7090036ba7b0 Mon Sep 17 00:00:00 2001 From: mjjo Date: Sun, 28 Jun 2015 22:34:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=EC=8A=B9=20=EC=A2=85=EB=AA=A9=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20ignore=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ Form1.cs | 50 +++++++++++++++++++++++++++++++++++ Properties/app.manifest | 54 ++++++++++++++++++++++++++++++++++++++ upper-limit-crawler.csproj | 39 ++++++++++++++++++++++++++- 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Properties/app.manifest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efdf9d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/ +obj/ +*.suo \ No newline at end of file diff --git a/Form1.cs b/Form1.cs index 0ce50dd..34d980d 100644 --- a/Form1.cs +++ b/Form1.cs @@ -8,10 +8,13 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; + namespace upper_limit_crawler { public partial class Form1 : Form { + CPSYSDIBLib.CpSvrNew7043 m_7043 = new CPSYSDIBLib.CpSvrNew7043(); + public Form1() { InitializeComponent(); @@ -19,7 +22,54 @@ namespace upper_limit_crawler private void btSearch_Click(object sender, EventArgs e) { + m_7043.SetInputValue(0, '1'); + m_7043.SetInputValue(1, '2'); + m_7043.SetInputValue(2, '1'); + m_7043.SetInputValue(3, 41); + m_7043.SetInputValue(4, '1'); + m_7043.SetInputValue(5, '0'); + m_7043.SetInputValue(6, '0'); + m_7043.SetInputValue(7, 0); + m_7043.SetInputValue(8, 30); + int iResult = m_7043.BlockRequest2(1); + if(iResult != 0) + { + MessageBox.Show("요청 에러"); + return; + } + + Console.WriteLine(string.Format("종목/현재가/대비플래그/대비/대비율/거래량/시가/시가대비/시가대비율/연속일")); + + bool bContinue = true; + while(bContinue) + { + int iCnt = m_7043.GetHeaderValue(0); + for (int i = 0; i < iCnt; i++) + { + object Code = m_7043.GetDataValue(0, i); + object Name = m_7043.GetDataValue(1, i); + object CurPrice = m_7043.GetDataValue(2, i); + object flag = m_7043.GetDataValue(3, i); + object Comp = m_7043.GetDataValue(4, i); + object CompRate = m_7043.GetDataValue(5, i); + object DealAmount = m_7043.GetDataValue(6, i); + object StartPrice = m_7043.GetDataValue(7, i); + object StartPriceComp = m_7043.GetDataValue(8, i); + object StartPriceCompRate = m_7043.GetDataValue(9, i); + object SerialDay = m_7043.GetDataValue(10, i); + + Console.WriteLine(string.Format("[{0}:{1}]/{2}/{3}/{4}/{5}/{6}/{7}/{8}/{9}/{10}", + Name, Code, + CurPrice, flag, Comp, CompRate, + DealAmount, StartPrice, StartPriceComp, StartPriceCompRate, + SerialDay)); + } + + bContinue = (m_7043.Continue == 1); + if (bContinue == true) + iResult = m_7043.BlockRequest2(1); + } } } } diff --git a/Properties/app.manifest b/Properties/app.manifest new file mode 100644 index 0000000..23a5e98 --- /dev/null +++ b/Properties/app.manifest @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/upper-limit-crawler.csproj b/upper-limit-crawler.csproj index e317af4..e7fb632 100644 --- a/upper-limit-crawler.csproj +++ b/upper-limit-crawler.csproj @@ -31,6 +31,18 @@ prompt 4 + + false + + + LocalIntranet + + + false + + + Properties\app.manifest + @@ -64,6 +76,9 @@ True Resources.resx + + Designer + SettingsSingleFileGenerator Settings.Designer.cs @@ -75,7 +90,29 @@ - + + Designer + + + + + {9C31B76A-7189-49A3-9781-3C6DD6ED5AD3} + 1 + 0 + 0 + tlbimp + False + True + + + {2DA9C35C-FE59-4A32-A942-325EE8A6F659} + 1 + 0 + 0 + tlbimp + False + True +