중간 커밋
This commit is contained in:
6
DataSaver/App.config
Normal file
6
DataSaver/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
91
DataSaver/DataSaver.csproj
Normal file
91
DataSaver/DataSaver.csproj
Normal file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" 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>{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>DataSaver</RootNamespace>
|
||||
<AssemblyName>DataSaver</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</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>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.v18.2, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Printing.v18.2.Core, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Utils.v18.2, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
<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" />
|
||||
<Reference Include="UIAutomationClient" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.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>
|
||||
</Compile>
|
||||
<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>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
99
DataSaver/MainForm.Designer.cs
generated
Normal file
99
DataSaver/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
namespace DataSaver
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// 필수 디자이너 변수입니다.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 사용 중인 모든 리소스를 정리합니다.
|
||||
/// </summary>
|
||||
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form 디자이너에서 생성한 코드
|
||||
|
||||
/// <summary>
|
||||
/// 디자이너 지원에 필요한 메서드입니다.
|
||||
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
|
||||
this.panelControl1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panelControl1
|
||||
//
|
||||
this.panelControl1.Controls.Add(this.groupBox3);
|
||||
this.panelControl1.Controls.Add(this.groupBox2);
|
||||
this.panelControl1.Controls.Add(this.groupBox1);
|
||||
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panelControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panelControl1.Name = "panelControl1";
|
||||
this.panelControl1.Size = new System.Drawing.Size(865, 126);
|
||||
this.panelControl1.TabIndex = 0;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Location = new System.Drawing.Point(13, 13);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(200, 100);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "groupBox1";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Location = new System.Drawing.Point(242, 13);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(200, 100);
|
||||
this.groupBox2.TabIndex = 0;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "groupBox1";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Location = new System.Drawing.Point(472, 13);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(185, 100);
|
||||
this.groupBox3.TabIndex = 0;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "groupBox1";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(865, 306);
|
||||
this.Controls.Add(this.panelControl1);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "Data Saver";
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
|
||||
this.panelControl1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl panelControl1;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
}
|
||||
}
|
||||
|
||||
20
DataSaver/MainForm.cs
Normal file
20
DataSaver/MainForm.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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 DataSaver
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DataSaver/MainForm.resx
Normal file
120
DataSaver/MainForm.resx
Normal 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>
|
||||
22
DataSaver/Program.cs
Normal file
22
DataSaver/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataSaver
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 해당 애플리케이션의 주 진입점입니다.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
DataSaver/Properties/AssemblyInfo.cs
Normal file
36
DataSaver/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
|
||||
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이러한 특성 값을 변경하세요.
|
||||
[assembly: AssemblyTitle("DataSaver")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DataSaver")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("d9de0f1b-ba15-421e-a263-6859f3d5a3bc")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
|
||||
// 기본값으로 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
DataSaver/Properties/Resources.Designer.cs
generated
Normal file
71
DataSaver/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 이 코드는 도구를 사용하여 생성되었습니다.
|
||||
// 런타임 버전:4.0.30319.42000
|
||||
//
|
||||
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
|
||||
// 이러한 변경 내용이 손실됩니다.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataSaver.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
|
||||
/// </summary>
|
||||
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
|
||||
// 클래스에서 자동으로 생성되었습니다.
|
||||
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
|
||||
// ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
|
||||
[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>
|
||||
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataSaver.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
|
||||
/// 재정의합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
DataSaver/Properties/Resources.resx
Normal file
117
DataSaver/Properties/Resources.resx
Normal 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>
|
||||
30
DataSaver/Properties/Settings.Designer.cs
generated
Normal file
30
DataSaver/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 DataSaver.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
DataSaver/Properties/Settings.settings
Normal file
7
DataSaver/Properties/Settings.settings
Normal 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>
|
||||
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29806.167
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Million", "Million\Million.csproj", "{10EF08CB-BF38-4882-A92A-30DB34E8E8BD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataSaver", "DataSaver\DataSaver.csproj", "{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{10EF08CB-BF38-4882-A92A-30DB34E8E8BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10EF08CB-BF38-4882-A92A-30DB34E8E8BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10EF08CB-BF38-4882-A92A-30DB34E8E8BD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D9DE0F1B-BA15-421E-A263-6859F3D5A3BC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -26,23 +26,39 @@ namespace Million
|
||||
Bithum = 0,
|
||||
Upbit = 1
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 상수
|
||||
#region 빗썸 URL
|
||||
public static string BithumURL= "https://api.bithumb.com/public/candlestick/";
|
||||
public static string BithumURL_CandleStick = "https://api.bithumb.com/public/candlestick/";
|
||||
public static string BithumURL_CoinGoods = "https://api.bithumb.com/public/orderbook/ALL_KRW";
|
||||
#endregion
|
||||
|
||||
#region 업비트 URL
|
||||
public static string UpbitURL = "https://api.upbit.com/";
|
||||
public static string upbitURL_CandleStick = "https://api.bithumb.com/public/candlestick/";
|
||||
public static string UpbitURL_CoinGoods = "https://api.upbit.com/v1/market/all?isDetails=false";
|
||||
#endregion
|
||||
|
||||
#region 공용 리스트
|
||||
// 거래소 코인 종목 리스트
|
||||
public List<Data.CoinGoodsData> ConiCoinGoodsDataList;
|
||||
|
||||
public Dictionary<string, string> BithumEndPointTypeLIst = new Dictionary<string, string>
|
||||
{
|
||||
{"CandleStick","/public/CandleStic"}
|
||||
};
|
||||
#endregion
|
||||
|
||||
|
||||
#region 저장 데이터 관련
|
||||
// 저장 데이터 폴더 경로
|
||||
public static string SaveProgramDirecotryPath = $"{System.Windows.Forms.Application.StartupPath}\\SaveData";
|
||||
// ini 파일 경로
|
||||
public static string IniFileName = $"{SaveProgramDirecotryPath}\\" + "setting.ini";
|
||||
// 빗썸 코인 정보 파일 경로
|
||||
public static string BitThumJasonFilePath = $"{SaveProgramDirecotryPath}\\BithumCoinGoods.txt";
|
||||
// 업비트 코인 정보 파일 경로
|
||||
public static string UpbitJasonFileName = $"{SaveProgramDirecotryPath}\\" + "UpbitCoinGoods.txt";
|
||||
// 거래소 코인 종목 저장 파일 경로
|
||||
public static string BitThumJasonFilePath = $"{SaveProgramDirecotryPath}\\CoinGoods.txt";
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Million.Data
|
||||
{
|
||||
|
||||
@@ -8,16 +8,19 @@ namespace Million.Data
|
||||
{
|
||||
public class CandleDataList
|
||||
{
|
||||
// 거래소
|
||||
public CommonProperty.ExchangePlace ExchangePlace { get; set; }
|
||||
// 코인 종목
|
||||
// public
|
||||
public CoinGoodsData ConGoodsData { get; set; }
|
||||
// 캔들 데이터 (1분)
|
||||
public List<CandleDataList> CandleDataLists_Im { get; set; }
|
||||
// 캔들 데이터 (3분)
|
||||
// 캔들 데이터 (5분)
|
||||
// 캔들 데이터 (15분)
|
||||
// 캔들 데이터 (10분)
|
||||
// 캔들 데이터 (30분)
|
||||
// 캔들 데이터 (1시간)
|
||||
// 캔들 데이터 (1시간)
|
||||
|
||||
public List<CandleDataList> CandleDataLists_IH { get; set; }
|
||||
// 캔들 데이터 (6시간)
|
||||
// 캔들 데이터 (12시간)
|
||||
// 캔들 데이터 (24시간)
|
||||
public List<CandleDataList> CandleDataLists_Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,14 +164,8 @@
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="SaveData\BithumCoinGoods.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="SaveData\UpbitCoinGoods.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Folder Include="SaveData\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -35,9 +35,10 @@ namespace Million.SubForm
|
||||
var bitthumbWerServices = new BitthumbWerServices();
|
||||
const string sParams = "BTC_KRW/1m";
|
||||
var sRespBodyData = string.Empty;
|
||||
bitthumbWerServices.xcoinApiCall("/public/candlestick", sParams, ref sRespBodyData);
|
||||
|
||||
|
||||
WebServices.WebConnection.SendWebServer(CommonProperty.BithumURL_CandleStick, "CandleStick", "",
|
||||
CommonProperty.ExchangePlace.Bithum,
|
||||
CommonProperty.WebConnectionType.GET, DateTime.Now);
|
||||
|
||||
// 콤보박스 초기화
|
||||
var minDataList = new List<string> {"1m", "3m", "5m", "10m"};
|
||||
|
||||
@@ -1,61 +1,215 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using Million.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Million.WebServices
|
||||
{
|
||||
public class WebConnection
|
||||
{
|
||||
public static Dictionary<string,object> SendWebServer(CommonProperty.WebConnectionType webSocketType)
|
||||
public static object SendWebServer(string url,string bithumEndPointType, string postData, CommonProperty.ExchangePlace exchangePlace,
|
||||
CommonProperty.WebConnectionType webSocketType, DateTime dateTime)
|
||||
{
|
||||
switch (webSocketType)
|
||||
var returnJsonData = new Dictionary<string, object>();
|
||||
|
||||
try
|
||||
{
|
||||
case CommonProperty.WebConnectionType.POST:
|
||||
return SendWebPostType();
|
||||
case CommonProperty.WebConnectionType.GET:
|
||||
return SendWebGetType();
|
||||
default: break;
|
||||
var rgbyData = Encoding.ASCII.GetBytes(postData);
|
||||
|
||||
var uri = new Uri(url); // string 을 Uri 로 형변환
|
||||
var wReq = (HttpWebRequest)WebRequest.Create(uri); // WebRequest 객체 형성 및 HttpWebRequest 로 형변환
|
||||
|
||||
// GET, POST 구분
|
||||
switch (webSocketType)
|
||||
{
|
||||
case CommonProperty.WebConnectionType.GET:
|
||||
break;
|
||||
case CommonProperty.WebConnectionType.POST:
|
||||
wReq.Method = "POST"; // 전송 방법 "GET" or "POST"
|
||||
using (var stream = wReq.GetRequestStream())
|
||||
{
|
||||
stream.Write(rgbyData, 0, rgbyData.Length);
|
||||
}
|
||||
wReq.ContentType = "application/x-www-form-urlencoded";
|
||||
wReq.ContentLength = rgbyData.Length;
|
||||
break;
|
||||
}
|
||||
|
||||
// 거래소에 따른 헤더 파일 처리
|
||||
switch (exchangePlace)
|
||||
{
|
||||
case CommonProperty.ExchangePlace.Bithum:
|
||||
SetBithumHeader(wReq, "", "", "", "", dateTime);
|
||||
|
||||
switch (bithumEndPointType)
|
||||
{
|
||||
case "CandleStick":
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CommonProperty.ExchangePlace.Upbit:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
using (var wRes = (HttpWebResponse)wReq.GetResponse())
|
||||
{
|
||||
var respPostStream = wRes.GetResponseStream();
|
||||
var readerPost = new StreamReader(respPostStream, Encoding.GetEncoding("EUC-KR"), true);
|
||||
var resResult = readerPost.ReadToEnd();
|
||||
|
||||
switch (exchangePlace)
|
||||
{
|
||||
case CommonProperty.ExchangePlace.Bithum:
|
||||
SetBithumHeader(wReq, "", "", "", "", dateTime);
|
||||
|
||||
var resultData = JsonConvert.DeserializeObject<Dictionary<string, object>>(resResult);
|
||||
|
||||
// 오류 코드 예외처리
|
||||
var resultDataList = resultData["status"].ToString().Equals("0000")
|
||||
? resultData["data"]
|
||||
: null;
|
||||
|
||||
switch (bithumEndPointType)
|
||||
{
|
||||
case "CandleStick":
|
||||
var candleResultDataList = JsonConvert.DeserializeObject<List<List<string>>>(resultDataList.ToString());
|
||||
var candleDataList = new CandleDataList();
|
||||
foreach (var data in candleResultDataList)
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
return
|
||||
}
|
||||
break;
|
||||
case CommonProperty.ExchangePlace.Upbit:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (WebException webEx)
|
||||
{
|
||||
using (var Response = (HttpWebResponse)webEx.Response)
|
||||
{
|
||||
var nCode = Response.StatusCode;
|
||||
|
||||
using (var reader = new StreamReader(Response.GetResponseStream()))
|
||||
{
|
||||
var sRespBodyData = reader.ReadToEnd();
|
||||
|
||||
//return (JObject.Parse(sRespBodyData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> SendWebPostType()
|
||||
{
|
||||
var returnJsonData = new Dictionary<string, object>();
|
||||
|
||||
// POST할 데이터를 작성한다.
|
||||
StringBuilder postParams = new StringBuilder();
|
||||
postParams.Append("TEST1 = test1");
|
||||
postParams.Append("&TEST2 = test2");
|
||||
|
||||
// 타겟이 되는 웹페이지 URL
|
||||
var Url = "http://test.net";
|
||||
|
||||
// HttpWebRequest 오브젝트 생성
|
||||
var wReqFirst = (HttpWebRequest)WebRequest.Create(Url);
|
||||
|
||||
return returnJsonData;
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> SendWebGetType()
|
||||
|
||||
#region 빗썸 API Key 및 헤더 사용
|
||||
/// <summary>
|
||||
/// 빗썸 Request 헤더 데이터 추가
|
||||
/// </summary>
|
||||
/// <param name="wReq"></param>
|
||||
/// <param name="endPoint"> /public/candlestick </param>
|
||||
/// <param name="sPostData"></param>
|
||||
/// <param name="sApiSecret"></param>
|
||||
/// <param name="sApiKey"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static HttpWebRequest SetBithumHeader(HttpWebRequest wReq, string sPostData, string endPoint, string sApiSecret, string sApiKey, DateTime dateTime)
|
||||
{
|
||||
|
||||
var returnJsonData = new Dictionary<string, object>();
|
||||
/*
|
||||
StringBuilder getParams = new StringBuilder();
|
||||
getParams.Append("arg1=" + arg1);
|
||||
getParams.Append("&arg2=" + arg2);
|
||||
getParams.Append("&arg3=" + arg3);
|
||||
*/
|
||||
return returnJsonData;
|
||||
var sAPI_Sign = "";
|
||||
var nNonce = MicroSecTime(dateTime);
|
||||
|
||||
// POST 데이터인 경우에 Key 값 채움
|
||||
if (!string.IsNullOrEmpty(sPostData))
|
||||
{
|
||||
var sHMAC_Key = sApiSecret;
|
||||
var sHMAC_Data = endPoint + (char)0 + sPostData + (char)0 + nNonce.ToString();
|
||||
var sResult = Hash_HMAC(sHMAC_Key, sHMAC_Data);
|
||||
sAPI_Sign = Convert.ToBase64String(StringToByte(sResult));
|
||||
}
|
||||
|
||||
wReq.Headers.Add("Api-Key", sApiKey);
|
||||
wReq.Headers.Add("Api-Sign", sAPI_Sign);
|
||||
wReq.Headers.Add("Api-Nonce", nNonce.ToString());
|
||||
|
||||
return wReq;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 바이트 to String 변환
|
||||
private static string ByteToString(byte[] rgbyBuff)
|
||||
{
|
||||
var sHexStr = "";
|
||||
|
||||
|
||||
for (var nCnt = 0; nCnt < rgbyBuff.Length; nCnt++)
|
||||
{
|
||||
sHexStr += nCnt.ToString("x2"); // Hex format
|
||||
}
|
||||
|
||||
return (sHexStr);
|
||||
}
|
||||
|
||||
// String to Byte 변환
|
||||
private static byte[] StringToByte(string sStr)
|
||||
{
|
||||
var rgbyBuff = Encoding.UTF8.GetBytes(sStr);
|
||||
|
||||
return (rgbyBuff);
|
||||
}
|
||||
|
||||
// 빗썸 DateTime 형식 변환
|
||||
private static long MicroSecTime(DateTime dateTime)
|
||||
{
|
||||
long nEpochTicks = 0;
|
||||
long nUnixTimeStamp = 0;
|
||||
long nNowTicks = 0;
|
||||
long nowMiliseconds = 0;
|
||||
var sNonce = "";
|
||||
|
||||
nEpochTicks = new DateTime(1970, 1, 1).Ticks;
|
||||
dateTime = dateTime.ToUniversalTime();
|
||||
nNowTicks = dateTime.Ticks;
|
||||
nowMiliseconds = dateTime.Millisecond;
|
||||
|
||||
nUnixTimeStamp = ((nNowTicks - nEpochTicks) / TimeSpan.TicksPerSecond);
|
||||
|
||||
sNonce = nUnixTimeStamp.ToString() + nowMiliseconds.ToString("D03");
|
||||
|
||||
return (Convert.ToInt64(sNonce));
|
||||
}
|
||||
|
||||
private static string Hash_HMAC(string sKey, string sData)
|
||||
{
|
||||
var rgbyKey = Encoding.UTF8.GetBytes(sKey);
|
||||
|
||||
|
||||
using (var hmacsha512 = new HMACSHA512(rgbyKey))
|
||||
{
|
||||
hmacsha512.ComputeHash(Encoding.UTF8.GetBytes(sData));
|
||||
|
||||
return (ByteToString(hmacsha512.Hash));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user