80 lines
2.5 KiB
C#
80 lines
2.5 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 future_crawler
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
CPUTILLib.CpFutureCode m_FutCode = new CPUTILLib.CpFutureCode();
|
|
string m_strTargetFutCode = "101K9";
|
|
|
|
CPSYSDIBLib.FutOptChart m_FutChart = new CPSYSDIBLib.FutOptChart();
|
|
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btSearchCode_Click(object sender, EventArgs e)
|
|
{
|
|
int iCnt = m_FutCode.GetCount();
|
|
for (short i = 0; i < iCnt; i++)
|
|
{
|
|
string strCode = (string)m_FutCode.GetData(0, i);
|
|
string strName = (string)m_FutCode.GetData(1, i);
|
|
|
|
Console.WriteLine(string.Format("{0} / {1}", strCode, strName));
|
|
}
|
|
|
|
m_strTargetFutCode = (string)m_FutCode.GetData(0, 0);
|
|
lbFutCode.Text = m_strTargetFutCode;
|
|
}
|
|
|
|
private void btCrawling_Click(object sender, EventArgs e)
|
|
{
|
|
long[] aFields = new long[1];
|
|
aFields[0] = 0;
|
|
//aFields[1] = 1;
|
|
//aFields[2] = 2;
|
|
//aFields[3] = 3;
|
|
//aFields[4] = 4;
|
|
|
|
|
|
m_FutChart.SetInputValue(0, m_strTargetFutCode);
|
|
m_FutChart.SetInputValue(1, '1');
|
|
m_FutChart.SetInputValue(2, 20150617);
|
|
m_FutChart.SetInputValue(3, 20150601);
|
|
m_FutChart.SetInputValue(4, 0);
|
|
m_FutChart.SetInputValue(5, aFields);
|
|
m_FutChart.SetInputValue(6, 'S');
|
|
m_FutChart.SetInputValue(7, 1);
|
|
m_FutChart.SetInputValue(8, '0');
|
|
m_FutChart.SetInputValue(9, '0');
|
|
|
|
int iResult = m_FutChart.BlockRequest2(1);
|
|
if (iResult != 0)
|
|
MessageBox.Show("결과가 이상함");
|
|
|
|
int iCnt = m_FutChart.GetHeaderValue(3);
|
|
int iFieldCnt = m_FutChart.GetHeaderValue(1);
|
|
for(int i=0; i<iCnt; i++)
|
|
{
|
|
ulong date = m_FutChart.GetDataValue(0, i);
|
|
ulong time = m_FutChart.GetDataValue(1, i);
|
|
ulong mp = m_FutChart.GetDataValue(2, i);
|
|
ulong hp = m_FutChart.GetDataValue(3, i);
|
|
ulong lp = m_FutChart.GetDataValue(4, i);
|
|
|
|
Console.WriteLine(string.Format("{0}/{1}/{2}/{3}/{4}", date, time, mp, hp, lp));
|
|
}
|
|
}
|
|
}
|
|
}
|