{"id":143726,"date":"2019-05-04T09:35:06","date_gmt":"2019-05-04T01:35:06","guid":{"rendered":"https:\/\/gulass.cn\/?p=143726"},"modified":"2019-04-26T15:37:33","modified_gmt":"2019-04-26T07:37:33","slug":"csharp-base-first","status":"publish","type":"post","link":"https:\/\/gulass.cn\/csharp-base-first.html","title":{"rendered":"C#\u7f16\u7a0b\u5b66\u4e60(\u4e00\uff09"},"content":{"rendered":"
1.1\u00a0\u5f00\u59cb\u5728Visual\u00a0Studio\u00a02013\u73af\u5883\u4e2d\u7f16\u7a0b<\/strong><\/div>\n
\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\u662f\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u7a97\u53e3\u800c\u975e\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GUI\uff09\u4e2d\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/div>\n
\u96c6\u6210\u5f00\u53d1\u73af\u5883(Integrated\u00a0Development\u00a0Environment\uff0cIDE)<\/div>\n
1.2 \u7f16\u5199\u7b2c\u4e00\u4e2a\u7a0b\u5e8f<\/strong><\/div>\n
Program.cs \u6587\u4ef6\u5b9a\u4e49\u4e86Program\u7c7b\uff0c\u5176\u4e2d\u5305\u542bMain\u65b9\u6cd5\u3002\u5728C#\u4e2d\uff0c\u6240\u6709\u7684\u53ef\u662f\u6267\u884c\u4ee3\u7801\u90fd\u5fc5\u987b\u5728\u65b9\u6cd5\u4e2d\u5b9a\u4e49\uff0c\u800c\u65b9\u6cd5\u5fc5\u987b\u4ece\u5c5e\u4e8e\u7c7b\u6216\u7ed3\u6784\u3002<\/div>\n
Main\u65b9\u6cd5\u6307\u5b9a\u7a0b\u5e8f\u7684\u5165\u53e3\u3002\u8be5\u65b9\u6cd5\u5728Program\u7c7b\u4e2d\u5fc5\u987b\u5b9a\u4e49\u4e3a\u9759\u6001\u65b9\u6cd5\uff0c\u5426\u5219\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c.NET Framework \u53ef\u80fd\u4e0d\u628a\u5b83\u89c6\u4e3a\u8d77\u70b9\u3002<\/div>\n
Console\uff1a\u662f\u7531\u5e94\u7528\u7a0b\u5e8f\u5e94\u7528\u7684\u7a0b\u5e8f\u96c6\u63d0\u4f9b\u7684\u4e00\u4e2a\u7c7b\uff0c\u63d0\u4f9b\u4e86\u5728\u63a7\u5236\u53f0\u7a97\u53e3\u4e2d\u663e\u793a\u6d88\u606f\u548c\u8bfb\u53d6\u952e\u76d8\u8f93\u5165\u7684\u65b9\u6cd5\u3002<\/div>\n
\u3010\u6ce8\u610f\u3011Console\u662f\u5185\u5efa\u7684\u7c7b\u3002<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 WriteLine \u662f\u91cd\u8f7d\u65b9\u6cd5\u3002<\/div>\n
<\/div>\n
1.3 \u4f7f\u7528\u547d\u540d\u7a7a\u95f4<\/strong><\/div>\n
\u547d\u540d\u7a7a\u95f4(namespace)\uff1a\u5b83\u4e3a\u7c7b\u8fd9\u6837\u7684\u4e1c\u897f\u521b\u5efa\u5bb9\u5668\u3002\u540c\u540d\u7c7b\u5728\u4e0d\u540c\u547d\u540d\u7a7a\u95f4\u4e2d\u4e0d\u4f1a\u6df7\u6dc6\u3002<\/div>\n
Visual\u00a0Studio\u00a02013\u00a0\u73af\u5883\u9ed8\u8ba4\u4f7f\u7528\u9879\u76ee\u540d\u79f0\u4f5c\u4e3a\u9876\u7ea7\u547d\u540d\u7a7a\u95f4\u3002.NET\u00a0Framework\u00a0\u7c7b\u5e93(FCL)\u4e5f\u9075\u5faa\u8fd9\u4e2a\u7ea6\u5b9a\uff0c\u5b83\u7684\u6bcf\u4e2a\u7c7b\u90fd\u5728\u4e00\u4e2a\u547d\u540d\u7a7a\u95f4\u4e2d\u3002<\/div>\n
using\u00a0\u6307\u4ee4\uff0c\u7528\u4e8e\u9650\u5b9a\u8981\u4f7f\u7528\u7684\u547d\u540d\u7a7a\u95f4\u3002\u540c\u4e00\u4e2a\u6587\u4ef6\u540e\u7eed\u7684\u4ee3\u7801\u4e0d\u518d\u9700\u8981\u547d\u540d\u7a7a\u95f4\u9650\u5b9a\u5bf9\u8c61\u3002<\/div>\n
using\u00a0\u6307\u51fa\u4ee5\u540e\u4f7f\u7528\u7684\u540d\u79f0\u6765\u81ea\u6307\u5b9a\u7684\u547d\u540d\u7a7a\u95f4\uff0c\u5728\u4ee3\u7801\u4e2d\u4e0d\u5fc5\u5bf9\u540d\u79f0\u8fdb\u884c\u5b8c\u5168\u9650\u5b9a\u3002<\/div>\n
\u7c7b\u7f16\u8bd1\u5230\u7a0b\u5e8f\u96c6\u4e2d\u3002\u7a0b\u5e8f\u96c6\u662f\u6587\u4ef6\uff0c\u901a\u5e38\u4f7f\u7528.dll\u00a0\u6269\u5c55\u540d\u3002\u4e0d\u8fc7\uff0c\u4e25\u683c\u5730\u8bf4\uff0c\u5e26\u6709.exe\u00a0\u6269\u5c55\u540d\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e5f\u662f\u7a0b\u5e8f\u96c6\u3002<\/div>\n
\u3010\u6ce8\u610f\u3011\u7a0b\u5e8f\u96c6\u548c\u547d\u540d\u7a7a\u95f4\u5e76\u975e\u80af\u5b9a\u4e00\u5bf9\u4e00\u3002\u7a0b\u5e8f\u96c6\u4e2d\u53ef\u80fd\u5305\u542b\u591a\u4e2a\u547d\u540d\u7a7a\u95f4\u7684\u7c7b\uff0c\u800c\u4e00\u4e2a\u547d\u540d\u7a7a\u95f4\u53ef\u80fd\u8de8\u8d8a\u591a\u4e2a\u7a0b\u5e8f\u96c6<\/div>\n
1.4\u00a0\u521b\u5efa\u56fe\u5f62\u5e94\u7528\u7a0b\u5e8f<\/strong><\/div>\n
Visual\u00a0Studio\u00a02013\u00a0\u63d0\u4f9b\u4e24\u4e2a\u6a21\u677f\u6765\u521b\u5efa\u56fe\u5f62\u5e94\u7528\u7a0b\u5e8f\u3002\u4e00\u4e2a\u662f\u201cWindows\u00a0\u7a97\u4f53\u5e94\u7528\u7a0b\u5e8f\u201d\uff0c\u53e6\u4e00\u4e2a\u662f\u201cWPF\u00a0\u5e94\u7528\u7a0b\u5e8f\u201d\u3002<\/div>\n
\u00a0WPF(Windows\u00a0PresentationFoundation)\u662f.NET\u00a0Framework\u00a03.0\u00a0\u624d\u5f15\u5165\u7684\u65b0\u6280\u672f\u3002\u76f8\u8f83\u4e8e\u00a0Windows\u00a0\u7a97\u4f53\uff0c\u5b83\u63d0\u4f9b\u4e86\u8bb8\u591a\u66f4\u5148\u8fdb\u7684\u7279\u6027\u4e0e\u529f\u80fd\u3002\u6240\u6709\u65b0\u7684\u00a0Windows\u00a07\u00a0\u5f00\u53d1\u90fd\u5e94\u9009\u62e9\u5b83\u800c\u4e0d\u662fWindows\u00a0\u7a97\u4f53\u3002<\/div>\n
XAML\u00a0\u5168\u79f0\u662f\u00a0Extensible\u00a0Application\u00a0Markup\u00a0Language\uff0c\u5373\u201c\u53ef\u6269\u5c55\u5e94\u7528\u7a0b\u5e8f\u6807\u8bb0\u8bed\u8a00\u201d\uff0cWindows\u00a0Store\u00a0\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7\u5b83\u5b9a\u4e49\u00a0GUI\u00a0\u5e03\u5c40\u3002<\/div>\n
\u5728\u5178\u578b\u00a0WPF\u00a0\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0cUI\u00a0\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u7a97\u53e3\u6784\u6210\uff0c\u800c\u5728\u00a0Windows\u00a0Store\u00a0\u5e94\u7528\u4e2d\uff0c\u5bf9\u5e94\u672f\u8bed\u662f\u201c\u9875\u201d\u6216\u201c\u9875\u9762\u201d\uff08\u4e25\u683c\u5730\u8bf4\uff0cWPF\u00a0\u5e94\u7528\u7a0b\u5e8f\u4e5f\u80fd\u5305\u542b\u9875\uff0c\u4f46\u6211\u4e0d\u60f3\u628a\u95ee\u9898\u641e\u5f97\u66f4\u590d\u6742\uff09\u3002\u4e3a\u4e86\u907f\u514d\u52a8\u4e0d\u52a8\u5c31\u8bf4\u4ec0\u4e48\u201cWPF\u7a97\u53e3\u201d\u6216\u201cWindows\u00a0Store\u00a0\u5e94\u7528\u9875\u9762\u201d\uff0c\u4ee5\u540e\u5c31\u7b80\u5355\u5730\u8bf4\u201c\u7a97\u4f53\u201d\u3001\u201c\u9875\u9762\u201d\u6216\u201c\u9875\u201d\u3002\u4f46\u662f\uff0c\u4ecd\u7136\u8981\u7528\u201c\u7a97\u53e3\u201d\u4e00\u8bcd\u6307\u4ee3\u00a0Visual\u00a0Studio\u00a02013\u00a0\u5f00\u53d1\u73af\u5883\u7684\u754c\u9762\u5143\u7d20\uff0c\u6bd4\u5982\u201c\u8bbe\u8ba1\u89c6\u56fe\u201d\u548c\u201c\u4ee3\u7801\u548c\u6587\u672c\u7f16\u8f91\u5668\u201d\u7a97\u53e3<\/div>\n
\u4f7f\u7528\u201c\u8c03\u8bd5\u201d\u83dc\u5355\u4e2d\u7684\u201c\u542f\u52a8\u8c03\u8bd5\u201d\u547d\u4ee4\u8fd0\u884c\u7a0b\u5e8f\uff0c\u5e94\u7528\u7a0b\u5e8f\u4e5f\u4f1a\u8fd0\u884c\uff0c\u4f46\u547d\u4ee4\u7a97\u53e3\u5728\u663e\u793a\u201cHello\u00a0World!\u201d\u540e\u7acb\u5373\u5173\u95ed\uff0c\u4e0d\u4f1a\u505c\u4e0b\u6765\u7b49\u7740\u6309\u952e\u3002<\/div>\n
\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\u662f\u7531\u00a0Main\u00a0\u5b9a\u4e49\u7a0b\u5e8f\u7684\u8fd0\u884c\u5165\u53e3\u3002\u4f46\u56fe\u5f62\u5e94\u7528\u7a0b\u5e8f\u7a0d\u6709\u4e0d\u540c\u3002<\/div>\n
OnLaunched\u65b9\u6cd5\u5b83\u51b3\u5b9a\u7740\u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u65f6\u5982\u4f55\u663e\u793a\u7a97\u4f53\u3002<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\u662f\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u7a97\u53e3\u800c\u975e\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GUI\uff09\u4e2d\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002 \u96c6\u6210\u5f00\u53d1\u73af\u5883(Integrate […]<\/p>\n","protected":false},"author":1476,"featured_media":143732,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-143726","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/143726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1476"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=143726"}],"version-history":[{"count":9,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/143726\/revisions"}],"predecessor-version":[{"id":143799,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/143726\/revisions\/143799"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/143732"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=143726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=143726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=143726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}