{"id":7782,"date":"2022-07-08T11:29:54","date_gmt":"2022-07-08T02:29:54","guid":{"rendered":"https:\/\/www.auctionpro.co.kr\/?p=7782"},"modified":"2022-07-08T11:30:19","modified_gmt":"2022-07-08T02:30:19","slug":"c-application-%eb%b0%98%eb%b3%b5%ed%94%84%eb%a1%9c%ec%84%b8%ec%84%9c-%eb%a7%8c%eb%93%a4%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=7782","title":{"rendered":"C# application \ubc18\ubcf5\ud504\ub85c\uc138\uc11c \ub9cc\ub4e4\uae30"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\ud504\ub85c\uadf8\ub7a8\uc744 \ubd84\ub2e8\uc704\ub85c \ubc18\ubcf5 \ud560\uc218 \uc788\uac8c \ub9cc\ub4e4\uae30 <\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">1.\ub514\uc790\uc778<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat02.png\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"672\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat02.png\" alt=\"\" class=\"wp-image-7783\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat02.png 712w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat02-300x283.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2.\uc18c\uc2a4<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \">using System;\nusing System.Drawing;\nusing System.Windows.Forms;\nusing System.Threading;\n\nnamespace WinRuleCache\n{   \n    public partial class Form1 : Form\n    {\n        public Form1()\n        {\n            InitializeComponent();\n        }\n\n        private void Form1_Load(object sender, EventArgs e)\n        {\n            \/\/Start Stop \ubc84\ud2bc init\n            btnStart.Enabled = true;\n            btnStop.Enabled = false;\n\n            \/\/ Timer init\n            timer1.Enabled = false;\n            \/\/ cmbTime init\n            cmbTime.SelectedIndex = 1;\n\n            \/\/timer2 int\n            timer2.Enabled = false;\n            timer2.Interval = 2000;\n\n        }\n\n        private void Form1_Resize(object sender, EventArgs e)\n        {\n            groupBox1.Size = new Size(this.Width - 40, (this.Height - 75) \/ 2);\n\n            groupBox2.Top = groupBox1.Height + 20;\n            groupBox2.Size = new Size(this.Width - 40, this.Height - groupBox1.Height - 55);\n\n            \/\/log resize\n            txtLog.Size = new Size(groupBox2.Width - 40, groupBox2.Height - 60);\n        }\n\n        private void btnStart_Click(object sender, EventArgs e)\n        {\n            int sTime = 1000000;\n\n            switch (cmbTime.SelectedIndex)\n            {\n                case 0:\n                    sTime = 1 * 60 * 1000;  \/\/1\ubd84\n                    break;\n                case 1:\n                    sTime = 5 * 60 * 1000; \/\/5\ubd84\n                    break;\n                case 2:\n                    sTime = 10 * 60 * 1000; \/\/10\ubd84\n                    break;\n                default:\n                    sTime = 20 * 60 * 1000; \/\/20\ubd84 \n                    break;\n            }\n\n            timer2.Interval = 2000;\n            timer2.Enabled = true;\n            timer2.Start();\n\n            timer1.Interval = sTime;\n            timer1.Enabled = true;\n            timer1.Start();\n\n            btnStart.Enabled = false;\n            btnStop.Enabled = true;\n\n            LogShow(\"\ud504\ub85c\uadf8\ub7a8\uc744 \uc2dc\uc791 \ud569\ub2c8\ub2e4.\");\n            Repeat();\n\n        }\n\n        private void btnStop_Click(object sender, EventArgs e)\n        {\n            \/\/stop \ubc84\ud2bc\uc744 \ub204\ub974\uba74 \n            btnStart.Enabled = true;\n            btnStop.Enabled = false;\n\n            LogShow(\"\uc911\uc9c0 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.\");\n\n            timer2.Stop();\n            timer2.Enabled = false;\n\n            timer1.Stop();\n            timer1.Enabled = false;\n\n            toolStripProgressBar1.Value = 0;\n        }\n\n        private void timer1_Tick(object sender, EventArgs e)\n        {\n            Repeat();\n        }\n\n        \/\/\ub85c\uadf8 \ubfcc\ub824\uc8fc\uae30 \ud568\uc218 \n        private void LogShow(string LogDate)\n        {\n            if (txtLog.Text.Length &gt; 1000)\n                txtLog.Text = DateTime.Now.ToString() + \" \" + LogDate;\n            else\n                txtLog.Text = txtLog.Text + \"\\r\\n\" + DateTime.Now.ToString() + \" \" + LogDate;\n\n            txtLog.SelectionStart = txtLog.Text.Length;\n            txtLog.ScrollToCaret();\n            txtLog.Refresh();\n        }\n\n        private void timer2_Tick(object sender, EventArgs e)\n        {\n            toolStripProgressBar1.Value = 0;\n\n            Thread.Sleep(1000);\n\n            toolStripProgressBar1.Value = 100;\n        }\n       \n\n        private void cmbTime_KeyUp(object sender, KeyEventArgs e)\n        {\n            e.Handled = true;\n        }\n      \n        private void Repeat()\n        {\n            LogShow(\" \uacc4\uc18d \ubc18\ubcf5 \ud569\ub2c8\ub2e4..\");\n        }\n\n    }\n        \n}\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3.\uc2e4\ud589<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat.png\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"403\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat.png\" alt=\"\" class=\"wp-image-7784\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat.png 605w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/07\/CSharp_Repeat-300x200.png 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\ud504\ub85c\uadf8\ub7a8\uc744 \ubd84\ub2e8\uc704\ub85c \ubc18\ubcf5 \ud560\uc218 \uc788\uac8c \ub9cc\ub4e4\uae30 1.\ub514\uc790\uc778 2.\uc18c\uc2a4 3.\uc2e4\ud589<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-7782","post","type-post","status-publish","format-standard","hentry","category-devc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7782"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7782\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}