initial commit

This commit is contained in:
2017-02-08 16:30:22 +09:00
commit 3329b69460
31 changed files with 69216 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
bin/
obj/
.vs/
configure/
log/
publish/
*.user

6
App.config Normal file
View File

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

93
CodeList.cs Normal file
View File

@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
namespace VICrawlerNS
{
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}", m_strCode, m_strName);
}
}
CPUTILLib.CpStockCode m_StockCode = new CPUTILLib.CpStockCode();
List<CODE_VALUE> m_CodeList = new List<CODE_VALUE>();
public CodeList()
{
MakeList();
Test();
}
void Test()
{
}
void MakeList()
{
CPUTILLib.CpCodeMgr CodeMgr = new CPUTILLib.CpCodeMgr();
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);
var CodeMarketKind = CodeMgr.GetStockMarketKind(Code.m_strCode);
var CodeSectionKind = CodeMgr.GetStockSectionKind(Code.m_strCode);
//if(Code.m_strCode[0] == 'A' &&
// (CodeMarketKind != CPUTILLib.CPE_MARKET_KIND.CPC_MARKET_FREEBOARD) &&
// (CodeSectionKind == CPUTILLib.CPE_KSE_SECTION_KIND.CPC_KSE_SECTION_KIND_NULL ||
// CodeSectionKind == CPUTILLib.CPE_KSE_SECTION_KIND.CPC_KSE_SECTION_KIND_ST))
//{
// m_CodeList.Add(Code);
//}
if(Code.m_strCode[0] == 'A')
m_CodeList.Add(Code);
}
m_CodeList.Sort((a, b) => b.m_strName.Length-a.m_strName.Length);
}
public CODE_VALUE GetCode(string strCode)
{
CODE_VALUE Result = m_CodeList.Find(s => s.m_strCode == strCode);
if(Result == null)
{
Result = new CODE_VALUE();
Result.m_strCode = strCode;
Result.m_strName = "";
}
return Result;
}
public CODE_VALUE GetCodeByName(string strCodeName)
{
CODE_VALUE Result = m_CodeList.Find(s => s.m_strName == strCodeName);
return Result;
}
}
}

100
Config.cs Normal file
View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace VICrawlerNS
{
static class Config
{
static Dictionary<string, object> m_Data = new Dictionary<string, object>();
static Random m_Random = new Random();
public static void Init()
{
m_Data.Add("account", "");
m_Data.Add("sub-account", "");
m_Data.Add("check-time", 5);
m_Data.Add("buy-price", 1000000);
Load();
}
static void Load()
{
string strPath = Util.GetConfigPath()+"/config.ini";
if(File.Exists(strPath) == false)
return;
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;
if(m_Data.ContainsKey(aTokens[0]) == true)
m_Data[aTokens[0]] = Convert.ChangeType(aTokens[1], m_Data[aTokens[0]].GetType());
else
m_Data.Add(aTokens[0], aTokens[1]);
}
}
static void Save()
{
string strContents = "";
foreach(KeyValuePair<string, object> pair in m_Data)
strContents += pair.Key + "=" + pair.Value.ToString() + Environment.NewLine;
string strPath = Util.GetConfigPath()+"/config.ini";
File.WriteAllText(strPath, strContents, new UTF8Encoding(true));
}
public static void SetAccount(string strAccount, string strAccountSub)
{
if(strAccount != null)
m_Data["account"] = strAccount;
m_Data["sub-account"] = strAccountSub;
Save();
}
public static string GetAccount()
{
return (string)m_Data["account"];
}
public static string GetSubAccount()
{
return (string)m_Data["sub-account"];
}
public static void SetCheckTime(int iCheckTime)
{
m_Data["check-time"] = iCheckTime;
Save();
}
public static int GetCheckTime()
{
return (int)m_Data["check-time"];
}
public static void SetBuyPrice(int iPrice)
{
m_Data["buy-price"] = iPrice;
Save();
}
public static int GetBuyPrice()
{
return (int)m_Data["buy-price"];
}
}
}

138
CybosHelper.cs Normal file
View File

@@ -0,0 +1,138 @@
using CPSYSDIBLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace VICrawlerNS
{
class CybosHelper
{
VICrawler m_Listener = null;
CPUTILLib.CpCybos m_CPCybos = new CPUTILLib.CpCybos();
CPFORETRADELib.CpForeTdUtil m_CPUtil = new CPFORETRADELib.CpForeTdUtil();
CpSvr9619S m_9619S = new CpSvr9619S();
public CybosHelper(VICrawler Listener)
{
m_Listener = Listener;
}
public void InitCybos()
{
short iResult = m_CPUtil.TradeInit();
switch (iResult)
{
case -1:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 4");
break;
case 0:
Util.Log(Util.LOG_TYPE.VERVOSE, "[TradeInit] 로그인 되었습니다");
break;
case 1:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 업무 키 입력 잘못됨");
break;
case 2:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 계좌 비밀번호가 잘못되었습니다");
break;
case 3:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 취소되었습니다");
break;
}
m_Listener.SetAccountList(m_CPUtil.AccountNumber);
SubscribeVICrawler();
}
public int GetLimitRemainCountTrade()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_TRADE_REQUEST);
}
public int GetLimitRemainCountRQ()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_NONTRADE_REQUEST);
}
public int GetLimitRemainCountSB()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_SUBSCRIBE);
}
public bool IsConnected()
{
return (m_CPCybos.IsConnect==1);
}
void SubscribeVICrawler()
{
m_9619S.Received += VICrawler_Received;
m_9619S.Subscribe();
}
private void VICrawler_Received()
{
uint uiTime = m_9619S.GetHeaderValue(0);
sbyte cType = m_9619S.GetHeaderValue(1);
string strCode = m_9619S.GetHeaderValue(3);
ushort uiEventCode = m_9619S.GetHeaderValue(4);
string strDesc = m_9619S.GetHeaderValue(5);
uint uiEndTime = m_9619S.GetHeaderValue(7);
sbyte cUpDown = m_9619S.GetHeaderValue(8);
ushort uiDegree = m_9619S.GetHeaderValue(9);
Console.WriteLine(string.Format("{0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8} | {9}",
m_9619S.GetHeaderValue(0),
m_9619S.GetHeaderValue(1),
m_9619S.GetHeaderValue(2),
m_9619S.GetHeaderValue(3),
m_9619S.GetHeaderValue(4),
m_9619S.GetHeaderValue(5),
m_9619S.GetHeaderValue(6),
m_9619S.GetHeaderValue(7),
m_9619S.GetHeaderValue(8),
m_9619S.GetHeaderValue(9)
));
m_Listener.OnReceivedEvent(uiTime, strCode, uiEventCode, strDesc, cUpDown=='U');
}
public void Buy(CodeList.CODE_VALUE Code, int iBuyPrice)
{
try
{
DSCBO1Lib.StockMst CPStockMst = new DSCBO1Lib.StockMst();
CPStockMst.SetInputValue(0, Code.m_strCode);
CPStockMst.BlockRequest2(0);
int iCurPrice = CPStockMst.GetHeaderValue(11);
iCurPrice = (int)(iCurPrice*1.015);
int iCount = iBuyPrice/iCurPrice;
CPTRADELib.CpTd0311 CP0311 = new CPTRADELib.CpTd0311();
CP0311.SetInputValue(0, 2);
CP0311.SetInputValue(1, Config.GetAccount());
CP0311.SetInputValue(2, Config.GetSubAccount());
CP0311.SetInputValue(3, Code.m_strCode);
CP0311.SetInputValue(4, iCount);
CP0311.SetInputValue(5, iCurPrice);
CP0311.SetInputValue(7, "01");
CP0311.SetInputValue(8, "01");
CP0311.BlockRequest2(1);
Util.Log(Util.LOG_TYPE.BUY, string.Format("code:{0} {1}주 현재가 {2}원, 지정가 매수", Code.ToString(), iCount, iCurPrice));
}
catch(Exception ex)
{
Util.Log(Util.LOG_TYPE.ERROR, ex.Message+Environment.NewLine+ex.StackTrace);
}
}
}
}

73
ExcelHandler.cs Normal file
View File

@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
//using Excel = Microsoft.Office.Interop.Excel;
using System.Reflection;
using OfficeOpenXml;
using System.Drawing;
using OfficeOpenXml.Style;
namespace VICrawlerNS
{
public class ExcelHandler
{
string m_strFileName = "";
string m_strToday = DateTime.Now.ToString("yyyy-MM-dd");
public ExcelHandler(string strFileName, string[] astrColumns)
{
m_strFileName = strFileName;
if(File.Exists(m_strFileName) == false)
Create(astrColumns);
}
private void Create(string[] astrColumns)
{
lock(this)
{
FileInfo newFile = new FileInfo(m_strFileName);
ExcelPackage package = new ExcelPackage(newFile);
ExcelWorksheet Sheet = package.Workbook.Worksheets.Add("sheet");
for(int i = 0; i<astrColumns.Length; i++)
Sheet.Cells[1, i+1].Value = astrColumns[i];
package.Save();
}
}
public bool AddRow(object[] row)
{
lock(this)
{
FileInfo newFile = new FileInfo(m_strFileName);
ExcelPackage package = new ExcelPackage(newFile);
ExcelWorksheet Sheet = package.Workbook.Worksheets["sheet"];
int iRowNo = Sheet.Dimension.Rows+1;
for(int i=0; i<row.Length; i++)
{
Sheet.Cells[iRowNo, i+1].Value = row[i];
if(row[i].GetType() == typeof(int))
{
Sheet.Cells[iRowNo, i+1].Style.Numberformat.Format = "###,###,##0";
}
else if(row[i].GetType() == typeof(float))
{
Sheet.Cells[iRowNo, i+1].Style.Numberformat.Format = "###,###,##0.00";
float fValue = (float)row[i];
Sheet.Cells[iRowNo, i+1].Style.Font.Color.SetColor(fValue>0 ? Color.Red : fValue<0 ? Color.Blue : Color.Black);
}
}
Sheet.Cells.AutoFitColumns(0);
package.Save();
}
return true;
}
}
}

27
ListViewNF.cs Normal file
View File

@@ -0,0 +1,27 @@
using System.Windows.Forms;
namespace VICrawlerNS
{
public partial class ListViewNF : ListView
{
public ListViewNF()
{
//Activate double buffering
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
//Enable the OnNotifyMessage event so we get a chance to filter out
// Windows messages before they get to the form's WndProc
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
}
protected override void OnNotifyMessage(Message m)
{
//Filter out the WM_ERASEBKGND message
if (m.Msg != 0x14)
{
base.OnNotifyMessage(m);
}
}
}
}

111
PriceCheck.cs Normal file
View File

@@ -0,0 +1,111 @@
using DSCBO1Lib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VICrawlerNS
{
public class PriceCheck
{
int m_iSeq;
string m_strCode;
string m_strCodeName;
int m_iStartPrice = int.MinValue;
int m_iLowPrice = int.MaxValue;
float m_fLowP = float.MaxValue;
int m_iHighPrice = int.MinValue;
float m_fHighP = float.MinValue;
int m_iCurPrice = int.MinValue;
DateTime m_StartTime;
DateTime m_EndTime;
StockCur m_StockCur = new StockCur();
VICrawler m_Listener = null;
bool m_bEnd = false;
bool m_bCancel = true;
int m_iCheckTimeInSec;
System.Timers.Timer m_Timer = new System.Timers.Timer();
public PriceCheck(int iSeq, string strCode, string strCodeName, VICrawler Listener, int iTimeInSec)
{
m_iSeq = iSeq;
m_strCode = strCode;
m_strCodeName = strCodeName;
m_Listener = Listener;
m_StartTime = DateTime.Now;
m_EndTime = m_StartTime + TimeSpan.FromSeconds(iTimeInSec);
m_StockCur.SetInputValue(0, strCode);
m_StockCur.Received += StockCur_Received;
m_StockCur.Subscribe();
m_iCheckTimeInSec = iTimeInSec;
m_bCancel = true;
m_Timer.Interval = 10*1000;
m_Timer.Elapsed += Timer_Elapsed;
m_Timer.Start();
}
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if(m_bCancel == true)
{
if(m_iStartPrice < 0)
{
Stop();
}
else
{
m_Timer.Stop();
m_Timer.Interval = (m_iCheckTimeInSec-10)*1000;
m_Timer.Start();
}
m_bCancel = false;
}
else
{
Stop();
}
}
public bool IsEnd()
{
return m_bEnd;
}
private void Stop()
{
m_Listener.OnPriceCheckEnd(m_iSeq, m_iStartPrice, m_iLowPrice, m_fLowP, m_iHighPrice, m_fHighP);
m_StockCur.Unsubscribe();
m_bEnd = true;
}
private void StockCur_Received()
{
m_iCurPrice = m_StockCur.GetHeaderValue(13);
if(m_iStartPrice == int.MinValue)
{
m_iStartPrice = m_iCurPrice;
m_Listener.OnReceivedStartPrice(m_iSeq, m_iStartPrice);
}
m_iLowPrice = Math.Min(m_iLowPrice, m_iCurPrice);
m_fLowP = m_iLowPrice/(float)m_iStartPrice;
m_iHighPrice = Math.Max(m_iHighPrice, m_iCurPrice);
m_fHighP = m_iHighPrice/(float)m_iStartPrice;
}
public override string ToString()
{
return string.Format("[{0}] {1:n0}({2:n0} | {3:n0} | {4:n0})", m_strCodeName, m_iCurPrice, m_iStartPrice, m_iLowPrice, m_iHighPrice);
}
}
}

22
Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VICrawlerNS
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new VICrawler());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VICrawler")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VICrawler")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d22b6894-b97f-4b53-92d3-d2b77fc929d5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

63
Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VICrawlerNS.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VICrawlerNS.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

117
Properties/Resources.resx Normal file
View File

@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

26
Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VICrawlerNS.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

70
Properties/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>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
</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>

137
Util.cs Normal file
View File

@@ -0,0 +1,137 @@
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 VICrawlerNS
{
static class Util
{
public enum LOG_TYPE
{
DEBUG,
ERROR,
VERVOSE,
BUY,
SELL,
}
static string m_strLogFile = null;
static RichTextBox m_LogBox = null;
delegate void InsertLogDelegate(RichTextBox LogBox, LOG_TYPE enType, string strLog);
static InsertLogDelegate m_InsertLogDelegate = new InsertLogDelegate(InsertLog);
public static void SetLogView(RichTextBox logBox)
{
m_LogBox = logBox;
}
public static void Clear()
{
m_LogBox = null;
}
static void InsertLog(RichTextBox LogBox, LOG_TYPE enType, string strLog)
{
if(LogBox.InvokeRequired)
{
LogBox.Invoke(m_InsertLogDelegate, 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.SELL:
LogColor = Color.Blue;
break;
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()+"/VICrawlerLog-"+strToday+".txt";
}
string strLogLevel = "["+enType+"] ";
string strTime = DateTime.Now.ToString("[HH:mm:ss:fff] ");
string strMessage = strTime+strLogLevel+strLog;
File.AppendAllText(m_strLogFile, strMessage+Environment.NewLine, new UTF8Encoding(true));
if(m_LogBox != null)
InsertLog(m_LogBox, enType, strMessage+Environment.NewLine);
Console.WriteLine(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;
}
}
}

458
VICrawler.Designer.cs generated Normal file
View File

@@ -0,0 +1,458 @@
namespace VICrawlerNS
{
partial class VICrawler
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VICrawler));
this.materialTabSelector1 = new MaterialSkin.Controls.MaterialTabSelector();
this.materialTabControl1 = new MaterialSkin.Controls.MaterialTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.lbInfo = new MaterialSkin.Controls.MaterialLabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lvItems = new VICrawlerNS.ListViewNF();
this.chSeq = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCBTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chRecvTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCodeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chEvent = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chDesc = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chStartPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chLowPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chLowP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chHighPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chHighP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tbLog = new System.Windows.Forms.RichTextBox();
this.btCybos = new MaterialSkin.Controls.MaterialRaisedButton();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tbSubAccount = new MaterialSkin.Controls.MaterialSingleLineTextField();
this.cbAccount = new System.Windows.Forms.ComboBox();
this.materialLabel4 = new MaterialSkin.Controls.MaterialLabel();
this.materialLabel2 = new MaterialSkin.Controls.MaterialLabel();
this.btApply = new MaterialSkin.Controls.MaterialFlatButton();
this.tbCheckTime = new MaterialSkin.Controls.MaterialSingleLineTextField();
this.materialLabel1 = new MaterialSkin.Controls.MaterialLabel();
this.materialLabel3 = new MaterialSkin.Controls.MaterialLabel();
this.materialFlatButton1 = new MaterialSkin.Controls.MaterialFlatButton();
this.materialTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// materialTabSelector1
//
this.materialTabSelector1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.materialTabSelector1.BaseTabControl = this.materialTabControl1;
this.materialTabSelector1.Depth = 0;
this.materialTabSelector1.Location = new System.Drawing.Point(0, 64);
this.materialTabSelector1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialTabSelector1.Name = "materialTabSelector1";
this.materialTabSelector1.Size = new System.Drawing.Size(1074, 49);
this.materialTabSelector1.TabIndex = 1;
this.materialTabSelector1.Text = "materialTabSelector1";
//
// materialTabControl1
//
this.materialTabControl1.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.materialTabControl1.Controls.Add(this.tabPage1);
this.materialTabControl1.Controls.Add(this.tabPage2);
this.materialTabControl1.Depth = 0;
this.materialTabControl1.Location = new System.Drawing.Point(3, 115);
this.materialTabControl1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialTabControl1.Name = "materialTabControl1";
this.materialTabControl1.SelectedIndex = 0;
this.materialTabControl1.Size = new System.Drawing.Size(1068, 572);
this.materialTabControl1.TabIndex = 2;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.materialFlatButton1);
this.tabPage1.Controls.Add(this.lbInfo);
this.tabPage1.Controls.Add(this.splitContainer1);
this.tabPage1.Controls.Add(this.btCybos);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1060, 546);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Items";
this.tabPage1.UseVisualStyleBackColor = true;
//
// lbInfo
//
this.lbInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lbInfo.AutoSize = true;
this.lbInfo.Depth = 0;
this.lbInfo.Font = new System.Drawing.Font("Roboto", 11F);
this.lbInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lbInfo.Location = new System.Drawing.Point(827, 6);
this.lbInfo.MouseState = MaterialSkin.MouseState.HOVER;
this.lbInfo.Name = "lbInfo";
this.lbInfo.Size = new System.Drawing.Size(227, 19);
this.lbInfo.TabIndex = 4;
this.lbInfo.Text = "00 | 000 | yyyy-MM-dd HH:mm:ss";
//
// 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, 35);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lvItems);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tbLog);
this.splitContainer1.Size = new System.Drawing.Size(1060, 511);
this.splitContainer1.SplitterDistance = 355;
this.splitContainer1.TabIndex = 1;
//
// lvItems
//
this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chSeq,
this.chCBTime,
this.chRecvTime,
this.chCode,
this.chCodeName,
this.chEvent,
this.chDesc,
this.chStartPrice,
this.chLowPrice,
this.chLowP,
this.chHighPrice,
this.chHighP});
this.lvItems.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvItems.FullRowSelect = true;
this.lvItems.GridLines = true;
this.lvItems.Location = new System.Drawing.Point(0, 0);
this.lvItems.Name = "lvItems";
this.lvItems.Size = new System.Drawing.Size(1060, 355);
this.lvItems.TabIndex = 0;
this.lvItems.UseCompatibleStateImageBehavior = false;
this.lvItems.View = System.Windows.Forms.View.Details;
this.lvItems.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvItems_ColumnClick);
//
// chSeq
//
this.chSeq.Text = "Seq.";
this.chSeq.Width = 39;
//
// chCBTime
//
this.chCBTime.Text = "시간";
this.chCBTime.Width = 59;
//
// chRecvTime
//
this.chRecvTime.Text = "받은 시간";
this.chRecvTime.Width = 80;
//
// chCode
//
this.chCode.Text = "코드";
this.chCode.Width = 73;
//
// chCodeName
//
this.chCodeName.Text = "종목명";
this.chCodeName.Width = 102;
//
// chEvent
//
this.chEvent.Text = "코드";
this.chEvent.Width = 53;
//
// chDesc
//
this.chDesc.Text = "신호";
this.chDesc.Width = 314;
//
// chStartPrice
//
this.chStartPrice.Text = "시가";
this.chStartPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.chStartPrice.Width = 71;
//
// chLowPrice
//
this.chLowPrice.Text = "저가";
this.chLowPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chLowP
//
this.chLowP.Text = "대비";
this.chLowP.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chHighPrice
//
this.chHighPrice.Text = "고가";
this.chHighPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chHighP
//
this.chHighP.Text = "대비";
this.chHighP.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// tbLog
//
this.tbLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbLog.Location = new System.Drawing.Point(0, 0);
this.tbLog.Name = "tbLog";
this.tbLog.Size = new System.Drawing.Size(1060, 152);
this.tbLog.TabIndex = 0;
this.tbLog.Text = "";
//
// btCybos
//
this.btCybos.AutoSize = true;
this.btCybos.Depth = 0;
this.btCybos.Location = new System.Drawing.Point(3, 3);
this.btCybos.MouseState = MaterialSkin.MouseState.HOVER;
this.btCybos.Name = "btCybos";
this.btCybos.Primary = true;
this.btCybos.Size = new System.Drawing.Size(66, 28);
this.btCybos.TabIndex = 3;
this.btCybos.Text = "Cybos";
this.btCybos.UseVisualStyleBackColor = true;
this.btCybos.Click += new System.EventHandler(this.btCybos_Click);
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.Color.White;
this.tabPage2.Controls.Add(this.tbSubAccount);
this.tabPage2.Controls.Add(this.cbAccount);
this.tabPage2.Controls.Add(this.materialLabel4);
this.tabPage2.Controls.Add(this.materialLabel2);
this.tabPage2.Controls.Add(this.btApply);
this.tabPage2.Controls.Add(this.tbCheckTime);
this.tabPage2.Controls.Add(this.materialLabel1);
this.tabPage2.Controls.Add(this.materialLabel3);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1060, 546);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Preference";
//
// tbSubAccount
//
this.tbSubAccount.Depth = 0;
this.tbSubAccount.Hint = "";
this.tbSubAccount.Location = new System.Drawing.Point(211, 45);
this.tbSubAccount.MouseState = MaterialSkin.MouseState.HOVER;
this.tbSubAccount.Name = "tbSubAccount";
this.tbSubAccount.PasswordChar = '\0';
this.tbSubAccount.SelectedText = "";
this.tbSubAccount.SelectionLength = 0;
this.tbSubAccount.SelectionStart = 0;
this.tbSubAccount.Size = new System.Drawing.Size(32, 23);
this.tbSubAccount.TabIndex = 13;
this.tbSubAccount.UseSystemPasswordChar = false;
//
// cbAccount
//
this.cbAccount.FormattingEnabled = true;
this.cbAccount.Location = new System.Drawing.Point(84, 45);
this.cbAccount.Name = "cbAccount";
this.cbAccount.Size = new System.Drawing.Size(121, 20);
this.cbAccount.TabIndex = 12;
//
// materialLabel4
//
this.materialLabel4.AutoSize = true;
this.materialLabel4.Depth = 0;
this.materialLabel4.Font = new System.Drawing.Font("Roboto", 11F);
this.materialLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.materialLabel4.Location = new System.Drawing.Point(5, 45);
this.materialLabel4.MouseState = MaterialSkin.MouseState.HOVER;
this.materialLabel4.Name = "materialLabel4";
this.materialLabel4.Size = new System.Drawing.Size(73, 19);
this.materialLabel4.TabIndex = 11;
this.materialLabel4.Text = "Account :";
//
// materialLabel2
//
this.materialLabel2.AutoSize = true;
this.materialLabel2.Depth = 0;
this.materialLabel2.Font = new System.Drawing.Font("Roboto", 11F);
this.materialLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.materialLabel2.Location = new System.Drawing.Point(136, 105);
this.materialLabel2.MouseState = MaterialSkin.MouseState.HOVER;
this.materialLabel2.Name = "materialLabel2";
this.materialLabel2.Size = new System.Drawing.Size(38, 19);
this.materialLabel2.TabIndex = 10;
this.materialLabel2.Text = "min.";
//
// btApply
//
this.btApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btApply.AutoSize = true;
this.btApply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btApply.Depth = 0;
this.btApply.Font = new System.Drawing.Font("Malgun Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.btApply.Location = new System.Drawing.Point(887, 454);
this.btApply.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
this.btApply.MinimumSize = new System.Drawing.Size(120, 0);
this.btApply.MouseState = MaterialSkin.MouseState.HOVER;
this.btApply.Name = "btApply";
this.btApply.Primary = false;
this.btApply.Size = new System.Drawing.Size(120, 36);
this.btApply.TabIndex = 9;
this.btApply.Text = "적용";
this.btApply.UseVisualStyleBackColor = true;
this.btApply.Click += new System.EventHandler(this.btApply_Click);
//
// tbCheckTime
//
this.tbCheckTime.Depth = 0;
this.tbCheckTime.Hint = "";
this.tbCheckTime.Location = new System.Drawing.Point(109, 105);
this.tbCheckTime.MouseState = MaterialSkin.MouseState.HOVER;
this.tbCheckTime.Name = "tbCheckTime";
this.tbCheckTime.PasswordChar = '\0';
this.tbCheckTime.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbCheckTime.SelectedText = "";
this.tbCheckTime.SelectionLength = 0;
this.tbCheckTime.SelectionStart = 0;
this.tbCheckTime.Size = new System.Drawing.Size(21, 23);
this.tbCheckTime.TabIndex = 8;
this.tbCheckTime.Text = "5";
this.tbCheckTime.UseSystemPasswordChar = false;
//
// materialLabel1
//
this.materialLabel1.AutoSize = true;
this.materialLabel1.Depth = 0;
this.materialLabel1.Font = new System.Drawing.Font("Roboto", 11F);
this.materialLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.materialLabel1.Location = new System.Drawing.Point(6, 105);
this.materialLabel1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialLabel1.Name = "materialLabel1";
this.materialLabel1.Size = new System.Drawing.Size(97, 19);
this.materialLabel1.TabIndex = 7;
this.materialLabel1.Text = "Check Time :";
//
// materialLabel3
//
this.materialLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.materialLabel3.AutoSize = true;
this.materialLabel3.Depth = 0;
this.materialLabel3.Font = new System.Drawing.Font("Roboto", 11F);
this.materialLabel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.materialLabel3.Location = new System.Drawing.Point(6, 524);
this.materialLabel3.MouseState = MaterialSkin.MouseState.HOVER;
this.materialLabel3.Name = "materialLabel3";
this.materialLabel3.Size = new System.Drawing.Size(165, 19);
this.materialLabel3.TabIndex = 6;
this.materialLabel3.Text = "Version : 2017.02.07.09";
//
// materialFlatButton1
//
this.materialFlatButton1.AutoSize = true;
this.materialFlatButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.materialFlatButton1.Depth = 0;
this.materialFlatButton1.Location = new System.Drawing.Point(285, 3);
this.materialFlatButton1.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6);
this.materialFlatButton1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialFlatButton1.Name = "materialFlatButton1";
this.materialFlatButton1.Primary = false;
this.materialFlatButton1.Size = new System.Drawing.Size(172, 36);
this.materialFlatButton1.TabIndex = 5;
this.materialFlatButton1.Text = "materialFlatButton1";
this.materialFlatButton1.UseVisualStyleBackColor = true;
this.materialFlatButton1.Click += new System.EventHandler(this.materialFlatButton1_Click);
//
// VICrawler
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1074, 690);
this.Controls.Add(this.materialTabSelector1);
this.Controls.Add(this.materialTabControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "VICrawler";
this.Text = "VICrawler";
this.materialTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private MaterialSkin.Controls.MaterialTabSelector materialTabSelector1;
private MaterialSkin.Controls.MaterialTabControl materialTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.SplitContainer splitContainer1;
private ListViewNF lvItems;
private System.Windows.Forms.ColumnHeader chCodeName;
private System.Windows.Forms.ColumnHeader chStartPrice;
private System.Windows.Forms.RichTextBox tbLog;
private MaterialSkin.Controls.MaterialRaisedButton btCybos;
private System.Windows.Forms.ColumnHeader chCode;
private MaterialSkin.Controls.MaterialLabel materialLabel3;
private System.Windows.Forms.ColumnHeader chLowPrice;
private System.Windows.Forms.ColumnHeader chLowP;
private System.Windows.Forms.ColumnHeader chHighPrice;
private System.Windows.Forms.ColumnHeader chHighP;
private System.Windows.Forms.ColumnHeader chEvent;
private System.Windows.Forms.ColumnHeader chSeq;
private System.Windows.Forms.ColumnHeader chCBTime;
private System.Windows.Forms.ColumnHeader chRecvTime;
private MaterialSkin.Controls.MaterialLabel lbInfo;
private MaterialSkin.Controls.MaterialLabel materialLabel2;
private MaterialSkin.Controls.MaterialFlatButton btApply;
private MaterialSkin.Controls.MaterialSingleLineTextField tbCheckTime;
private MaterialSkin.Controls.MaterialLabel materialLabel1;
private System.Windows.Forms.ColumnHeader chDesc;
private MaterialSkin.Controls.MaterialSingleLineTextField tbSubAccount;
private System.Windows.Forms.ComboBox cbAccount;
private MaterialSkin.Controls.MaterialLabel materialLabel4;
private MaterialSkin.Controls.MaterialFlatButton materialFlatButton1;
}
}

313
VICrawler.cs Normal file
View File

@@ -0,0 +1,313 @@
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections;
using System.Collections.Concurrent;
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 VICrawlerNS
{
public partial class VICrawler : MaterialForm
{
class ITEM
{
public int m_iSeq;
public string m_strCode;
public string m_strCodeName;
public uint m_uiEventCode;
public string m_strDesc;
public DateTime m_RecevedTime;
public int m_iStartPrice = 0;
public int m_iLowPrice = 10000000;
public float m_fLowP = 0.0f;
public int m_iHighPrice = 0;
public float m_fHighP = 0.0f;
}
CybosHelper m_CybosHelper = null;
List<ITEM> m_ItemList = new List<ITEM>();
List<PriceCheck> m_PriceCheckList = new List<PriceCheck>();
CodeList m_CodeList = new CodeList();
ExcelHandler m_Excel = new ExcelHandler(Util.GetLogPath()+"/PriceCheck-"+DateTime.Now.ToString("yyyy-MM-dd")+".xlsx",
new string[] { "Seq", "받은 시간", "종목코드", "종목명", "코드", "신호", "시가", "저가", "대비", "고가", "대비" });
System.Timers.Timer m_SystemTimer = new System.Timers.Timer();
public VICrawler()
{
InitializeComponent();
lvItems.ListViewItemSorter = new ListViewItemComparer(chSeq.Index, SortOrder.Ascending);
lvItems.Sorting = SortOrder.Ascending;
Util.SetLogView(tbLog);
Config.Init();
tbCheckTime.Text = Config.GetCheckTime().ToString();
cbAccount.Items.Add(Config.GetAccount());
cbAccount.SelectedItem = Config.GetAccount();
tbSubAccount.Text = Config.GetSubAccount();
m_CybosHelper = new CybosHelper(this);
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
m_SystemTimer.Interval = 100;
m_SystemTimer.Elapsed += SystemTimer_Elapsed;
m_SystemTimer.Start();
}
private void SystemTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if(lbInfo.InvokeRequired)
{
lbInfo.Invoke(new Action(() => {
lbInfo.Text = string.Format("{0} | {1} | {2}",
m_CybosHelper.GetLimitRemainCountRQ(),
m_CybosHelper.GetLimitRemainCountSB(),
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}));
//lbInfo.Location = new Point(lbInfo.Parent.Width-lbInfo.Width, lbInfo.Top);
}
else
{
lbInfo.Text = string.Format("{0} | {1}",
m_CybosHelper.GetLimitRemainCountRQ(),
m_CybosHelper.GetLimitRemainCountSB(),
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//lbInfo.Location = new Point(lbInfo.Parent.Width-lbInfo.Width, lbInfo.Top);
}
m_PriceCheckList.RemoveAll(s => s.IsEnd());
}
public void SetAccountList(string[] aAccountList)
{
cbAccount.Items.Clear();
cbAccount.Items.AddRange(aAccountList);
}
private void btCybos_Click(object sender, EventArgs e)
{
m_CybosHelper.InitCybos();
btCybos.Primary = false;
btCybos.Enabled = false;
}
public void OnReceivedEvent(uint uiTime, string strCode, uint uiEventCode, string strDesc, bool bUp)
{
int iSeq = lvItems.Items.Count+1;
CodeList.CODE_VALUE Code = m_CodeList.GetCode(strCode);
ITEM Item = new ITEM();
Item.m_iSeq = iSeq;
Item.m_strCode = strCode;
Item.m_strCodeName = Code.m_strName;
Item.m_uiEventCode = uiEventCode;
Item.m_strDesc = strDesc;
Item.m_RecevedTime = DateTime.Now;
Item.m_iStartPrice = 0;
m_ItemList.Add(Item);
if(lvItems.InvokeRequired)
{
lvItems.Invoke(new Action(() => {
lvItems.Items.Add(new ListViewItem(new string[]
{
iSeq.ToString(),
string.Format("{0:00}:{1:00}:{2:00}", uiTime/10000, (uiTime%10000)/100, uiTime%100),
Item.m_RecevedTime.ToString("hh:mm:ss.fff"),
strCode,
Item.m_strCodeName,
uiEventCode.ToString(),
strDesc,
"",
"",
"",
"",
""
}));
lvItems.Items[lvItems.Items.Count-1].UseItemStyleForSubItems = false;
}));
}
else
{
lvItems.Items.Add(new ListViewItem(new string[]
{
iSeq.ToString(),
string.Format("{0:00}:{1:00}:{2:00}", uiTime/10000, (uiTime%10000)/100, uiTime%100),
Item.m_RecevedTime.ToString("hh:mm:ss.fff"),
strCode,
Item.m_strCodeName,
uiEventCode.ToString(),
strDesc,
"",
"",
"",
"",
""
}));
lvItems.Items[lvItems.Items.Count-1].UseItemStyleForSubItems = false;
}
if((uiEventCode == 755 || uiEventCode == 757) /*&& bUp == true*/)
m_CybosHelper.Buy(Code, Config.GetBuyPrice());
m_PriceCheckList.Add(new PriceCheck(iSeq, strCode, Code.m_strName, this, Config.GetCheckTime()*60));
Util.Log(Util.LOG_TYPE.VERVOSE, string.Format("{0} / {1} / {2} / {3}",
uiTime, strCode, uiEventCode, strDesc));
}
public void OnReceivedStartPrice(int iSeq, int iStartPrice)
{
var Item = lvItems.Items.Cast<ListViewItem>().FirstOrDefault(s => s.SubItems[chSeq.Index].Text == iSeq.ToString());
if(Item == default(ListViewItem))
return;
if(lvItems.InvokeRequired)
{
lvItems.Invoke(new Action(() => {
Item.SubItems[chStartPrice.Index].Text = string.Format("{0:n0}", iStartPrice);
}));
}
else
{
Item.SubItems[chStartPrice.Index].Text = string.Format("{0:n0}", iStartPrice);
}
}
public void OnPriceCheckEnd(int iSeq, int iStartPrice, int iLowPrice, float fLowP, int iHighPrice, float fHighP)
{
if(lvItems.InvokeRequired)
{
lvItems.Invoke(new Action(() => {
var Item = lvItems.Items.Cast<ListViewItem>().FirstOrDefault(s => s.SubItems[chSeq.Index].Text == iSeq.ToString());
if(Item == default(ListViewItem))
return;
Item.SubItems[chStartPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chLowPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chLowP.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chHighPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chHighP.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
if(iHighPrice > 0)
{
Item.SubItems[chLowPrice.Index].Text = string.Format("{0:n0}", iLowPrice);
Item.SubItems[chLowPrice.Index].ForeColor = (iLowPrice > iStartPrice) ? Color.Red : (iLowPrice < iStartPrice) ? Color.Blue : Color.Black;
Item.SubItems[chLowP.Index].Text = string.Format("{0:n2}", (fLowP-1.0f)*100);
Item.SubItems[chLowP.Index].ForeColor = (fLowP > 1.0f) ? Color.Red : (fLowP < 1.0f) ? Color.Blue : Color.Black;
Item.SubItems[chHighPrice.Index].Text = string.Format("{0:n0}", iHighPrice);
Item.SubItems[chHighPrice.Index].ForeColor = (iHighPrice > iStartPrice) ? Color.Red : (iHighPrice < iStartPrice) ? Color.Blue : Color.Black;
Item.SubItems[chHighP.Index].Text = string.Format("{0:n2}", (fHighP-1.0f)*100);
Item.SubItems[chHighP.Index].ForeColor = (fHighP > 1.0f) ? Color.Red : (fHighP < 1.0f) ? Color.Blue : Color.Black;
}
}));
}
else
{
var Item = lvItems.Items.Cast<ListViewItem>().FirstOrDefault(s => s.SubItems[chSeq.Index].Text == iSeq.ToString());
if(Item == default(ListViewItem))
return;
Item.SubItems[chStartPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chLowPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chLowP.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chHighPrice.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
Item.SubItems[chHighP.Index].BackColor = Color.FromArgb(255, 245, 245, 245);
if(iHighPrice > 0)
{
Item.SubItems[chLowPrice.Index].Text = string.Format("{0:n0}", iLowPrice);
Item.SubItems[chLowPrice.Index].ForeColor = (iLowPrice > iStartPrice) ? Color.Red : (iLowPrice < iStartPrice) ? Color.Blue : Color.Black;
Item.SubItems[chLowP.Index].Text = string.Format("{0:n2}", (fLowP-1.0f)*100);
Item.SubItems[chLowP.Index].ForeColor = (fLowP > 1.0f) ? Color.Red : (fLowP < 1.0f) ? Color.Blue : Color.Black;
Item.SubItems[chHighPrice.Index].Text = string.Format("{0:n0}", iHighPrice);
Item.SubItems[chHighPrice.Index].ForeColor = (iHighPrice > iStartPrice) ? Color.Red : (iHighPrice < iStartPrice) ? Color.Blue : Color.Black;
Item.SubItems[chHighP.Index].Text = string.Format("{0:n2}", (fHighP-1.0f)*100);
Item.SubItems[chHighP.Index].ForeColor = (fHighP > 1.0f) ? Color.Red : (fHighP < 1.0f) ? Color.Blue : Color.Black;
}
}
{
ITEM Item = m_ItemList.Find(s => s.m_iSeq == iSeq);
m_Excel.AddRow(new object[] { iSeq, Item.m_RecevedTime, Item.m_strCode, Item.m_strCodeName, Item.m_uiEventCode, Item.m_strDesc,
iStartPrice, iLowPrice, fLowP, iHighPrice, fHighP});
}
}
private void lvItems_ColumnClick(object sender, ColumnClickEventArgs e)
{
SortOrder Order = (lvItems.Sorting == SortOrder.Descending || lvItems.Sorting == SortOrder.None) ? SortOrder.Ascending : SortOrder.Descending;
lvItems.ListViewItemSorter = new ListViewItemComparer(e.Column, Order);
lvItems.Sorting = Order;
lvItems.Sort();
}
private void btApply_Click(object sender, EventArgs e)
{
Config.SetAccount((string)cbAccount.SelectedItem, tbSubAccount.Text);
int iCheckTime;
bool bParsed = int.TryParse(tbCheckTime.Text, out iCheckTime);
if(bParsed == true)
Config.SetCheckTime(iCheckTime);
}
private void materialFlatButton1_Click(object sender, EventArgs e)
{
var Code = m_CodeList.GetCode("A095300");
m_CybosHelper.Buy(Code, 1000000);
}
}
class ListViewItemComparer : IComparer
{
int m_iColumn = 0;
SortOrder m_Order = SortOrder.Ascending;
public ListViewItemComparer(int column, SortOrder Order)
{
m_iColumn = column;
m_Order = Order;
}
public int Compare(object x, object y)
{
ListViewItem item1 = (ListViewItem)x;
ListViewItem item2 = (ListViewItem)y;
double num1;
double num2;
if(double.TryParse(item1.SubItems[m_iColumn].Text, out num1) &&
double.TryParse(item2.SubItems[m_iColumn].Text, out num2))
{
return (num1>num2) ? 1 : -1;
}
else
{
if(m_Order == SortOrder.Ascending)
return string.Compare(item1.SubItems[m_iColumn].Text, item2.SubItems[m_iColumn].Text);
else
return string.Compare(item2.SubItems[m_iColumn].Text, item1.SubItems[m_iColumn].Text);
}
}
}
}

234
VICrawler.csproj Normal file
View File

@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D22B6894-B97F-4B53-92D3-D2B77FC929D5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VICrawlerNS</RootNamespace>
<AssemblyName>VICrawler</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<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>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="EPPlus, Version=4.1.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>packages\EPPlus.4.1.0\lib\net40\EPPlus.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MaterialSkin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MaterialSkin.0.2.1\lib\MaterialSkin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeList.cs" />
<Compile Include="Config.cs" />
<Compile Include="CybosHelper.cs" />
<Compile Include="ExcelHandler.cs" />
<Compile Include="VICrawler.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="VICrawler.Designer.cs">
<DependentUpon>VICrawler.cs</DependentUpon>
</Compile>
<Compile Include="ListViewNF.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="PriceCheck.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util.cs" />
<EmbeddedResource Include="VICrawler.resx">
<DependentUpon>VICrawler.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<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>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if NOT "$(ConfigurationName)" == "Release" (goto :nocopy)
copy $(TargetPath) $(ProjectDir)publish\ /y
copy $(TargetDir)*.dll $(ProjectDir)publish\ /y
:nocopy
</PostBuildEvent>
</PropertyGroup>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

1787
VICrawler.resx Normal file

File diff suppressed because it is too large Load Diff

22
VICrawler.sln Normal file
View File

@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VICrawler", "VICrawler.csproj", "{D22B6894-B97F-4B53-92D3-D2B77FC929D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

5
packages.config Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EPPlus" version="4.1.0" targetFramework="net452" />
<package id="MaterialSkin" version="0.2.1" targetFramework="net452" />
</packages>

BIN
packages/EPPlus.4.1.0/EPPlus.4.1.0.nupkg vendored Normal file

Binary file not shown.

32621
packages/EPPlus.4.1.0/lib/net35/EPPlus.XML vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

32621
packages/EPPlus.4.1.0/lib/net40/EPPlus.XML vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

122
packages/EPPlus.4.1.0/lib/readme.txt vendored Normal file
View File

@@ -0,0 +1,122 @@
EPPlus 4.1
Visit epplus.codeplex.com for the latest information
EPPlus-Create Advanced Excel spreadsheet.
New features 4.0
Replaced Packaging API with DotNetZip
* This will remove any problems with Isolated Storage and enable multithreading
New Cell store
* Less memory consumption
* Insert columns (not on the range level)
* Faster row inserts,
Formula Parser
* Calculates all formulas in a workbook, a worksheet or in a specified range
* 100+ functions implemented
* Access via Calculate methods on Workbook, Worksheet and Range objects.
* Add custom/missing Excel functions via Workbook. FormulaParserManager.
* Samples added to the EPPlusSamples project.
The formula parser does not support Array Formulas
* Intersect operator (Space)
* References to external workbooks
* And probably a whole lot of other stuff as well :)
Performance
*Of course the performance of the formula parser is nowhere near Excels. Our focus has been functionality.
Agile Encryption (Office 2012-)
* Support for newer type of encryption.
Minor new features
* Chart worksheets
* New Chart Types Bubblecharts
* Radar Charts
* Area Charts
* And lots of bug fixes...
Beta 2 Changes
* Fixed bug when using RepeatColumns & RepeatRows at the same time.
* VBA project will be left untouched if its not accessed.
* Fixed problem with strings on save.
* Added locks to the cell store for access by multiple threads.
* Implemented Indirect function
* Used DisplayNameAttribute to generate column headers from LoadFromCollection
* Rewrote ExcelRangeBase.Copy function.
* Added caching to Save ZipStream for Cells and shared strings to speed up the Save method.
* Added Missing InsertColumn and DeleteColumn
* Added pull request to support Date1904
* Added pull request ExcelWorksheet. LoadFromDataReader
Release Candidate changes
* Fixed some problems with Range.Copy Function
* InsertColumn and Delete column didn't work in some cases
* Chart.DisplayBlankAs had the wrong default type in Excel 2010+
* Datavalidation list overflow caused corruption of the package
* Fixed a few Calculation when referring ranges (for example If function)
* Added ChartAxis.DisplayUnit
* Fixed a bug related to shared formulas
* Named styles failed in some cases.
* Style.Indent got an invalid value in some cases.
* Fixed a problem with AutofitColumns method.
* Performance fix.
* A whole lot of other small fixes.
4.0.1 Fixes
* VBA unreadable content
* Fixed a few issues with InsertRow and DeleteRow
* Fixed bug in Average and AverageA
* Handling of Div/0 in functions
* Fixed VBA CodeModule error when copying a worksheet.
* Value decoding when reading str element for cell value.
* Better exception when accessing a worksheet out of range in the Excelworksheets indexer.
* Added Small and Large function to formula parser. Performance fix when encountering an unknown function.
* Fixed handling strings in formulas
* Calculate hangs if formula start with a parenthes.
* Worksheet.Dimension returned an invalid range in some cases.
* Rowheight was wrong in some cases.
* ExcelSeries.Header had an incorrect validation check.
4.0.2 Fixes
* Fixes a whole bunch of bugs related to the cell store (Worksheet.InsertColumn, Worksheet.InsertRow, Worksheet.DeleteColumn, Worksheet.DeleteRow, Range.Copy, Range.Clear)
* Added functions Acos, Acosh, Asinh, Atanh, Atan, CountBlank, CountIfs, Mina, Offset, Median, Hyperlink, Rept
* Fix for reading Excel comment content from the t-element.
* Fix to make Range.LoadFromCollection work better with inheritence
* And alot of other small fixes
4.0.3 Fixes
* Added compilation directive for MONO (Thanks Danny)
* Added functions IfError, Char, Error.Type, Degrees, Fixed, IsNonText, IfNa and SumIfs
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.4 Fixes
* Added functions Daverage, Dvar Dvarp, DMax, DMin DSum, DGet, DCount and DCountA
* Exposed the formula parser logging functionality via FormulaParserManager.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.5 Fixes
* Switched to Visual Studio 2015 for code and sample projects.
* Added LineColor, MarkerSize, LineWidth and MarkerLineColor properties to line charts
* Added LineEnd properties to shapes
* Added functions Value, DateValue, TimeValue
* Removed WPF depedency.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.1
* Added functions Rank, Rank.eq, Rank.avg and Search
* Custom function compilers can now be added via FormulaParserManager
* Applied a whole bunch of pull requests...
* Performance and memory usage tweeks
* Ability to set and retrieve 'custom' extended application propeties.
* Added style QuotePrefix
* Added support for MajorTimeUnit and MinorTimeUnit to chart axes
* Added GapWidth Property to BarChart and Gapwidth.
* Added Fill and Border properties to ChartSerie.
* Added support for MajorTimeUnit and MinorTimeUnit to chart axes
* Insert/delete row/column now shifts named ranges, comments, tables and pivottables.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details

Binary file not shown.

Binary file not shown.