{"id":8332,"date":"2023-02-02T18:23:26","date_gmt":"2023-02-02T09:23:26","guid":{"rendered":"https:\/\/www.auctionpro.co.kr\/?p=8332"},"modified":"2023-02-04T10:25:45","modified_gmt":"2023-02-04T01:25:45","slug":"%eb%b9%84%eb%8f%99%ea%b8%b0-%ed%8c%8c%ec%9d%bc-%ec%95%a1%ec%84%b8%ec%8a%a4","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=8332","title":{"rendered":"\ube44\ub3d9\uae30 \ud30c\uc77c \uc561\uc138\uc2a4"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Overview :  async awit, async void  \ub97c \uad6c\ud604\ud574 \ubcf8\ub2e4.<\/h3>\n\n\n\n<h2 class=\"wp-block-heading\">1.async awit (net.core)<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" title=\"async Task \">public async Task ProcessWriteAsync()\n{\n    string filePath = \"temp.txt\";\n    string text = $\"Hello World{Environment.NewLine}\";\n    await WriteTextAsync(filePath, text);\n}\nasync Task WriteTextAsync(string filePath, string text)\n{\n    byte[] encodedText = Encoding.Unicode.GetBytes(text);\n    using var sourceStream =\n        new FileStream(\n            filePath,\n            FileMode.Create, FileAccess.Write, FileShare.None,\n            bufferSize: 4096, useAsync: true);\n    await sourceStream.WriteAsync(encodedText, 0, encodedText.Length);\n}<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"278\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/02\/transferring-files-yeti.gif\" alt=\"\" class=\"wp-image-8351\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2.async void (.net) <br>\uae30\ub2e4\ub9ac\uc9c0 \uc54a\uace0 \ud30c\uc77c \uc4f0\uae30 <\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" title=\"void \">SimpleWriteAsync(sPath, FileName, sText) \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\npublic static void SimpleWriteAsync(string sPath, string FileName, string sText)\n{\n\tstring PathFileName = sPath + @\"\\\" + FileName;\n\tTask k = WriteTextAsync(PathFileName, sText);  \/\/\ube44\ub3d9\uae30 \ud638\ucd9c\n}\npublic static async Task WriteTextAsync(string PathFileName, string sText)\n{   \n\tusing (FileStream fs = new FileStream(PathFileName, FileMode.Create))\n\t{\n\t\tusing (StreamWriter w = new StreamWriter(fs, Encoding.UTF8))\n\t\t{\n\t\t\tawait w.WriteAsync(sText);\n\t\t}\n\t}\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Overview : async awit, async void \ub97c \uad6c\ud604\ud574 \ubcf8\ub2e4. 1.async awit (net.core) 2.async void (.net) \uae30\ub2e4\ub9ac\uc9c0 \uc54a\uace0 \ud30c\uc77c \uc4f0\uae30<\/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":[241],"tags":[],"class_list":["post-8332","post","type-post","status-publish","format-standard","hentry","category-asynchronous"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8332","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=8332"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8332\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}