76 lines
2.6 KiB
C#
76 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
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();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|