]> insang Git - newton-cn_pos.git/commitdiff
일회용 매출, 비율
authornewton-cn <insang@kakao.com>
Tue, 28 Jan 2025 02:26:21 +0000 (11:26 +0900)
committernewton-cn <insang@kakao.com>
Tue, 28 Jan 2025 02:26:21 +0000 (11:26 +0900)
28 files changed:
.vs/newton-cn/v16/.suo
newton-cn/DBConnector.cs
newton-cn/Form1.Designer.cs
newton-cn/Form1.cs
newton-cn/Form6.Designer.cs [new file with mode: 0644]
newton-cn/Form6.cs [new file with mode: 0644]
newton-cn/Form6.resx [new file with mode: 0644]
newton-cn/USBControl.cs [new file with mode: 0644]
newton-cn/bin/Debug/newton-cn.exe
newton-cn/bin/Debug/newton-cn.pdb
newton-cn/bin/Release/newton-cn.exe
newton-cn/bin/Release/newton-cn.pdb
newton-cn/newton-cn.csproj
newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache
newton-cn/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache
newton-cn/obj/Debug/newton-cn.csproj.CoreCompileInputs.cache
newton-cn/obj/Debug/newton-cn.csproj.FileListAbsolute.txt
newton-cn/obj/Debug/newton-cn.csproj.GenerateResource.cache
newton-cn/obj/Debug/newton-cn.exe
newton-cn/obj/Debug/newton-cn.pdb
newton-cn/obj/Debug/newton_cn.Form6.resources [new file with mode: 0644]
newton-cn/obj/Release/newton-cn.csproj.CoreCompileInputs.cache
newton-cn/obj/Release/newton-cn.csproj.FileListAbsolute.txt
newton-cn/obj/Release/newton-cn.csproj.GenerateResource.cache
newton-cn/obj/Release/newton-cn.exe
newton-cn/obj/Release/newton-cn.pdb
newton-cn/obj/Release/newton_cn.Form6.resources [new file with mode: 0644]

index e8eeecf872b6410eaa0cc3e5dbbfd36be40da927..3ce2722255cea56683fd20269a22897baa342dce 100644 (file)
Binary files a/.vs/newton-cn/v16/.suo and b/.vs/newton-cn/v16/.suo differ
index a313725b597f7255b589917860b6f714ae9730d9..031ed1cb0873a927227e6d359002ed4435b4f91d 100644 (file)
@@ -10,6 +10,28 @@ namespace newton_cn
 {
     class DBConnector
     {
+        public DataTable getDisposableAnalysis(string year_month)
+        {
+            DataTable result = new DataTable();
+            string procedure = "disposable_analysis";
+#if DEBUG
+            SqlConnection conn = new SqlConnection("Data Source=newton-cn1.iptime.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;");
+#else
+            SqlConnection conn = new SqlConnection("Data Source=localhost; Initial Catalog=food; User ID=newton; Password=newton123!;");
+#endif
+            conn.Open();
+
+            
+            SqlCommand cmd_select = new SqlCommand(procedure, conn);
+            cmd_select.CommandType= CommandType.StoredProcedure;
+
+            cmd_select.Parameters.Add(new SqlParameter("@year_month", SqlDbType.NVarChar, 50)).Value = year_month;
+
+            SqlDataAdapter dataAdapter = new SqlDataAdapter(cmd_select);
+            dataAdapter.Fill(result);
+
+            return result;
+        }
         public int updateDisposableIsEarn_log(string pe_id, string ps_no)
         {
 #if DEBUG
index ffb2fa1893e80edbb0c282e8a79f0313b5250182..41417c884aa5f6c353f4008bf95e5776dedca2e7 100644 (file)
@@ -34,16 +34,17 @@ namespace newton_cn
             this.button3 = new System.Windows.Forms.Button();
             this.button4 = new System.Windows.Forms.Button();
             this.eclipseControl1 = new newton_cn.EclipseControl();
+            this.button5 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // button1
             // 
-            this.button1.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
-            this.button1.Location = new System.Drawing.Point(213, 4);
+            this.button1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+            this.button1.Location = new System.Drawing.Point(206, 4);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(58, 35);
+            this.button1.Size = new System.Drawing.Size(65, 35);
             this.button1.TabIndex = 0;
-            this.button1.Text = "상품";
+            this.button1.Text = "상품  검색";
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click_1);
             // 
@@ -60,10 +61,10 @@ namespace newton_cn
             // 
             // button3
             // 
-            this.button3.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
-            this.button3.Location = new System.Drawing.Point(111, 4);
+            this.button3.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+            this.button3.Location = new System.Drawing.Point(137, 4);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(96, 35);
+            this.button3.Size = new System.Drawing.Size(63, 35);
             this.button3.TabIndex = 2;
             this.button3.Text = "포인트사용";
             this.button3.UseVisualStyleBackColor = true;
@@ -71,10 +72,10 @@ namespace newton_cn
             // 
             // button4
             // 
-            this.button4.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
-            this.button4.Location = new System.Drawing.Point(9, 4);
+            this.button4.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+            this.button4.Location = new System.Drawing.Point(72, 4);
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(96, 35);
+            this.button4.Size = new System.Drawing.Size(59, 35);
             this.button4.TabIndex = 3;
             this.button4.Text = "일회용적립";
             this.button4.UseVisualStyleBackColor = true;
@@ -85,6 +86,17 @@ namespace newton_cn
             this.eclipseControl1.CornerRadius = 20;
             this.eclipseControl1.TargetControl = this;
             // 
+            // button5
+            // 
+            this.button5.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+            this.button5.Location = new System.Drawing.Point(12, 4);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(54, 35);
+            this.button5.TabIndex = 4;
+            this.button5.Text = "매출정보";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -92,6 +104,7 @@ namespace newton_cn
             this.BackColor = System.Drawing.SystemColors.ActiveCaption;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
             this.ClientSize = new System.Drawing.Size(313, 44);
+            this.Controls.Add(this.button5);
             this.Controls.Add(this.button4);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
@@ -113,6 +126,7 @@ namespace newton_cn
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button5;
     }
 }
 
index 4e8299840d322c1610593b1c78e5e2c097c288aa..939978bbf4f2c145e8470c60003ef300cb855662 100644 (file)
@@ -31,7 +31,7 @@ namespace newton_cn
         }
         private void Form1_Load(object sender, EventArgs e)
         {
-
+            
         }
 
         private void button1_Click_1(object sender, EventArgs e)
@@ -74,6 +74,13 @@ namespace newton_cn
 
             dlg.ShowDialog();
         }
+
+        private void button5_Click(object sender, EventArgs e)
+        {
+            Form6 dlg = new Form6();
+
+            dlg.ShowDialog();
+        }
     }
 
 
diff --git a/newton-cn/Form6.Designer.cs b/newton-cn/Form6.Designer.cs
new file mode 100644 (file)
index 0000000..07b7e18
--- /dev/null
@@ -0,0 +1,132 @@
+
+namespace newton_cn
+{
+    partial class Form6
+    {
+        /// <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()
+        {
+            this.button1 = new System.Windows.Forms.Button();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
+            this.button2 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+            this.button1.Location = new System.Drawing.Point(437, 2);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(31, 30);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "X";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Location = new System.Drawing.Point(3, 38);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.RowTemplate.Height = 23;
+            this.dataGridView1.Size = new System.Drawing.Size(465, 400);
+            this.dataGridView1.TabIndex = 1;
+            this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
+            // 
+            // dateTimePicker1
+            // 
+            this.dateTimePicker1.Location = new System.Drawing.Point(12, 5);
+            this.dateTimePicker1.Name = "dateTimePicker1";
+            this.dateTimePicker1.Size = new System.Drawing.Size(149, 21);
+            this.dateTimePicker1.TabIndex = 2;
+            this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(335, 5);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(58, 23);
+            this.button2.TabIndex = 3;
+            this.button2.Text = "다음달";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(173, 6);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(61, 23);
+            this.button3.TabIndex = 4;
+            this.button3.Text = "저번달";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(251, 6);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(62, 23);
+            this.button4.TabIndex = 5;
+            this.button4.Text = "이번달";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // Form6
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(469, 450);
+            this.ControlBox = false;
+            this.Controls.Add(this.button4);
+            this.Controls.Add(this.button3);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.dateTimePicker1);
+            this.Controls.Add(this.dataGridView1);
+            this.Controls.Add(this.button1);
+            this.Name = "Form6";
+            this.ShowIcon = false;
+            this.ShowInTaskbar = false;
+            this.Text = "Form6";
+            this.TopMost = true;
+            this.Load += new System.EventHandler(this.Form6_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.DateTimePicker dateTimePicker1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
+    }
+}
\ No newline at end of file
diff --git a/newton-cn/Form6.cs b/newton-cn/Form6.cs
new file mode 100644 (file)
index 0000000..3a1cfb0
--- /dev/null
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace newton_cn
+{
+    public partial class Form6 : Form
+    {
+        public Form6()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            Application.OpenForms["Form6"].Close();
+        }
+
+        private void Form6_Load(object sender, EventArgs e)
+        {
+            dateTimePicker1.Height = 150;
+            // DateTimePicker의 Format을 Custom으로 설정
+            dateTimePicker1.Format = DateTimePickerFormat.Custom;
+
+            // CustomFormat을 "yyyy-MM"으로 설정하여 월 단위만 표시
+            dateTimePicker1.CustomFormat = "yyyy-MM";
+
+            // 날짜 선택을 월 단위로 제한 (up-down 방식)
+            dateTimePicker1.ShowUpDown = true;
+            dateTimePicker1.Width = 150;  // 넓이 조정
+            dateTimePicker1.Height = 150;  // 높이 조정
+      
+
+            string todayFormatted = DateTime.Today.ToString("yyyy-MM");
+            
+            DBConnector dbc = new DBConnector();
+            dataGridView1.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
+            dataGridView1.DataSource = dbc.getDisposableAnalysis(todayFormatted);
+            dataGridView1.Columns["상품명"].Width = 200;
+        }
+
+        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+
+        }
+
+        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
+        {
+            DateTime selectedDate = dateTimePicker1.Value;
+            string result = selectedDate.ToString("yyyy-MM");
+
+            // 선택된 날짜 출력 (예: 콘솔에 출력)            
+            
+            DBConnector dbc = new DBConnector();
+            dataGridView1.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
+            dataGridView1.DataSource = dbc.getDisposableAnalysis(result);
+            dataGridView1.Columns["상품명"].Width = 200;
+        }
+
+        private void button4_Click(object sender, EventArgs e)
+        {
+            dateTimePicker1.Value = DateTime.Today;
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            // 현재 DateTimePicker 값에서 한 달 뒤의 날짜 계산
+            DateTime nextMonthDate = dateTimePicker1.Value.AddMonths(1);
+
+            // 오늘 날짜 (현재 연도와 월)
+            DateTime today = DateTime.Today;
+
+            // 한 달 뒤의 날짜가 오늘 날짜의 연도와 월을 넘기지 않도록 체크
+            if (nextMonthDate.Year > today.Year || (nextMonthDate.Year == today.Year && nextMonthDate.Month > today.Month))
+            {
+                // 한 달 뒤의 날짜가 오늘 날짜의 연도와 월을 넘기면, 오늘 날짜의 연도와 월로 설정
+                dateTimePicker1.Value = new DateTime(today.Year, today.Month, DateTime.DaysInMonth(today.Year, today.Month));
+            }
+            else
+            {
+                // 그렇지 않으면 한 달 뒤의 날짜로 설정
+                dateTimePicker1.Value = nextMonthDate;
+            }
+        }
+
+        private void button3_Click(object sender, EventArgs e)
+        {
+            dateTimePicker1.Value = dateTimePicker1.Value.AddMonths(-1);
+        }
+    }
+}
diff --git a/newton-cn/Form6.resx b/newton-cn/Form6.resx
new file mode 100644 (file)
index 0000000..7080a7d
--- /dev/null
@@ -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=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>
\ No newline at end of file
diff --git a/newton-cn/USBControl.cs b/newton-cn/USBControl.cs
new file mode 100644 (file)
index 0000000..b06c540
--- /dev/null
@@ -0,0 +1,63 @@
+using System;
+using System.Management;
+
+// ##### 유기중.... 언젠가 해야지
+
+class USBControl
+{
+    public static void test()
+    {
+        Console.WriteLine("현재 연결된 USB 장치 목록:");
+        Console.WriteLine("-----------------------------------");
+        string result = "";
+        try
+        {
+            // Win32_PnPEntity 클래스에서 USB 관련 장치 검색
+            string query = "SELECT * FROM Win32_PnPEntity WHERE DeviceID LIKE '%046D%' and Name= 'HID 규격 마우스'";
+            using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query))
+            {
+                foreach (ManagementObject device in searcher.Get())
+                {
+                    Console.WriteLine($"이름: {device["Name"]}");
+                    Console.WriteLine($"장치 ID: {device["DeviceID"]}");
+                    Console.WriteLine($"설명: {device["Description"]}");
+                    Console.WriteLine("-----------------------------------");
+
+                    ManagementBaseObject disabled = device.InvokeMethod("Disable", null, null);
+
+                    System.Threading.Thread.Sleep(5000);
+
+                    ManagementBaseObject enabled = device.InvokeMethod("Enable", null, null);
+                }
+            }
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine($"USB 장치 정보를 가져오는 중 오류 발생: {ex.Message}");
+        }
+    }
+
+    // 장치 비활성화
+    public static void DisableDevice(string deviceId)
+    {
+        string query = $"SELECT * FROM Win32_PnPEntity WHERE DeviceID = '{deviceId}'";
+        ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
+        foreach (ManagementObject device in searcher.Get())
+        {
+            ManagementBaseObject outParams = device.InvokeMethod("Disable", null, null);
+            Console.WriteLine($"장치 {deviceId}가 비활성화되었습니다.");
+        }
+    }
+
+    // 장치 활성화
+    public static void EnableDevice(string deviceId)
+    {
+        string query = $"SELECT * FROM Win32_PnPEntity WHERE DeviceID = '{deviceId}'";
+        ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
+        foreach (ManagementObject device in searcher.Get())
+        {
+            ManagementBaseObject outParams = device.InvokeMethod("Enable", null, null);
+            Console.WriteLine($"장치 {deviceId}가 활성화되었습니다.");
+        }
+    }
+}
\ No newline at end of file
index 5aae992908a76e872a9e54eb84905b3f3ee08604..a69d1f76511d0d031b7527f52ebc23d855d3dd37 100644 (file)
Binary files a/newton-cn/bin/Debug/newton-cn.exe and b/newton-cn/bin/Debug/newton-cn.exe differ
index 7952fa67139db34acbeaed9aae788bfcd6eabd06..cc2f4126dbb5940a1c52f8eae8d53e05ee9aac8c 100644 (file)
Binary files a/newton-cn/bin/Debug/newton-cn.pdb and b/newton-cn/bin/Debug/newton-cn.pdb differ
index fda79b3b436ee24d4a1e75bb16e4baa8d2639dd0..9dad505da478fc1cfc44984295d9e4ff7f56d1e3 100644 (file)
Binary files a/newton-cn/bin/Release/newton-cn.exe and b/newton-cn/bin/Release/newton-cn.exe differ
index 39e9d370e88d8a03e229d705a29393bde5be9213..9462d7c206cded471394c1954c6fa649797e56d4 100644 (file)
Binary files a/newton-cn/bin/Release/newton-cn.pdb and b/newton-cn/bin/Release/newton-cn.pdb differ
index bd6bac9abe412ec00077b8a052197c3f926b8e6b..dd3b963a696bb43856cdf45c42303c57c34e508c 100644 (file)
@@ -51,6 +51,7 @@
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Management" />
     <Reference Include="System.Workflow.ComponentModel" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="WindowsBase" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Form6.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form6.Designer.cs">
+      <DependentUpon>Form6.cs</DependentUpon>
+    </Compile>
+    <Compile Include="USBControl.cs" />
     <Compile Include="EclipseControl.cs">
       <SubType>Component</SubType>
     </Compile>
     <EmbeddedResource Include="Form5.resx">
       <DependentUpon>Form5.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Form6.resx">
+      <DependentUpon>Form6.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
index bcd570125e47562b351c709370137eea0fd21e63..16804eb4ef6cd2d14a363e2b5348b410032130df 100644 (file)
Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
index 6fcb73d1c46f16c4722b0620ce042fe5bc19c62a..6e6e6e5b13adb8556e52f99a4bfb00d08ffa88f2 100644 (file)
Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
index 2261fee3971550fb7234414bf40ff813c045f9e1..654fe63c3d45a2e8165502122afabf3ee530b55b 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache and b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache differ
index f4ffa1ccffdf52703a794b583cef4aa362ab6eaf..2c3bfcf41f2d1b2bd0f52630de2eb6f667c5ec62 100644 (file)
@@ -1 +1 @@
-9c927f7136556afac3ccb2fe06ffe7b69bd3cafc
+77becbbe38540d75bcab8131eb90cecf1ed49f05
index 4d5bac0870fc759730284e7a3c0a7b3c601d7f30..2684ab137aeabc566736766e0008ffb45d23911d 100644 (file)
@@ -34,3 +34,4 @@ z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.ex
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.pdb
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form5.resources
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.csproj.AssemblyReference.cache
+z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form6.resources
index 1fabc86fa27053ab8dff0a0dc5ef48927a19592c..1d4883f3caeffb4f2b1ff2b6b081f279c156b6c6 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.csproj.GenerateResource.cache and b/newton-cn/obj/Debug/newton-cn.csproj.GenerateResource.cache differ
index 5aae992908a76e872a9e54eb84905b3f3ee08604..a69d1f76511d0d031b7527f52ebc23d855d3dd37 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.exe and b/newton-cn/obj/Debug/newton-cn.exe differ
index 7952fa67139db34acbeaed9aae788bfcd6eabd06..cc2f4126dbb5940a1c52f8eae8d53e05ee9aac8c 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.pdb and b/newton-cn/obj/Debug/newton-cn.pdb differ
diff --git a/newton-cn/obj/Debug/newton_cn.Form6.resources b/newton-cn/obj/Debug/newton_cn.Form6.resources
new file mode 100644 (file)
index 0000000..06c24d0
Binary files /dev/null and b/newton-cn/obj/Debug/newton_cn.Form6.resources differ
index 649318431f15cb0582847beee738ae3e5f2c75e0..5a340117e496a539ab5f0de856f6849eec949bb5 100644 (file)
@@ -1 +1 @@
-4315477b5f16310b27f3cb468e963765dec56f29
+429a19c000682c0a0625c1880a6c3805ece4a6fe
index 61349cd438d5c62257bc9a4e55cdd7348f021988..f9abb88ce5e92bc86345f82af225af64d0208a1f 100644 (file)
@@ -33,3 +33,4 @@ z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton-cn.
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form3.resources
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form4.resources
 z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form5.resources
+z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form6.resources
index 3d4625fc95d65182e0de5a006ff497bf91cf29a8..1d4883f3caeffb4f2b1ff2b6b081f279c156b6c6 100644 (file)
Binary files a/newton-cn/obj/Release/newton-cn.csproj.GenerateResource.cache and b/newton-cn/obj/Release/newton-cn.csproj.GenerateResource.cache differ
index fda79b3b436ee24d4a1e75bb16e4baa8d2639dd0..9dad505da478fc1cfc44984295d9e4ff7f56d1e3 100644 (file)
Binary files a/newton-cn/obj/Release/newton-cn.exe and b/newton-cn/obj/Release/newton-cn.exe differ
index 39e9d370e88d8a03e229d705a29393bde5be9213..9462d7c206cded471394c1954c6fa649797e56d4 100644 (file)
Binary files a/newton-cn/obj/Release/newton-cn.pdb and b/newton-cn/obj/Release/newton-cn.pdb differ
diff --git a/newton-cn/obj/Release/newton_cn.Form6.resources b/newton-cn/obj/Release/newton_cn.Form6.resources
new file mode 100644 (file)
index 0000000..06c24d0
Binary files /dev/null and b/newton-cn/obj/Release/newton_cn.Form6.resources differ