{"id":8991,"date":"2014-08-05T18:11:06","date_gmt":"2014-08-05T10:11:06","guid":{"rendered":"http:\/\/bohu.net\/blog\/?p=8991"},"modified":"2014-08-05T18:11:06","modified_gmt":"2014-08-05T10:11:06","slug":"%e9%80%9a%e8%bf%87%e5%8a%a8%e6%80%81%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%8e%b7%e5%8f%96%e5%8f%98%e9%87%8f%e5%80%bc-%e8%8e%b7%e5%8f%96%e5%8f%98%e9%87%8f%e5%90%8d%e7%a7%b0","status":"publish","type":"post","link":"https:\/\/as32.net\/blog\/8991\/","title":{"rendered":"\u901a\u8fc7\u52a8\u6001\u5b57\u7b26\u4e32\u83b7\u53d6\u53d8\u91cf\u503c &#038; \u83b7\u53d6\u53d8\u91cf\u540d\u79f0"},"content":{"rendered":"<p>\u4e00\u6bb5\u5b9e\u4f8b\u4ee3\u7801, \u5728 c#\u4e2d\u901a\u8fc7 Linq \u53d6\u53d8\u91cf\u7684\u540d\u79f0, \u4ee5\u53ca \u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a\u53d8\u91cf\u540d\uff0c\u901a\u8fc7\u5b57\u7b26\u4e32\u7ed9\u53d8\u91cf\u8d4b\u503c.<\/p>\n<pre class=\"brush:csharp\">        string strApp = \"app\";\n        public string app = \"AAA\";\n        public string strTest = \"TEST\";\n        protected void Button1_Click(object sender, EventArgs e)\n        {\n\n            \/\/\u901a\u8fc7\u5b57\u7b26\u4e32\u83b7\u5f97\u53d8\u91cf\u503c\n            string aaa1 = this.GetType().GetField(\"app\").GetValue(this).ToString();\n            \/\/\u6216\u8005\n            string aaa2 = this.GetType().GetField(strApp).GetValue(this).ToString();\n            \/\/\u901a\u8fc7\u7ed9\u53d8\u91cf\u8d4b\u503c\n            this.GetType().GetField(\"strTest\").SetValue(this, \"C#123\");\n            \/\/\u65b0\u7684\u503c\n            string bbb = this.GetType().GetField(\"strTest\").GetValue(this).ToString();\n\n            \/\/\u83b7\u53d6\u53d8\u91cf\u540d\u79f0\n            string ccc = GetVarName(p=&gt;this.strTest);\n        }\n\n        \/\/\u83b7\u53d6\u53d8\u91cf\u540d\u79f0\n        public static string GetVarName(System.Linq.Expressions.Expression&lt;Func&lt;string, string&gt;&gt; exp)\n\u3000\u3000    {\n            return ((System.Linq.Expressions.MemberExpression)exp.Body).Member.Name;\n\u3000\u3000    }<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6bb5\u5b9e\u4f8b\u4ee3\u7801, \u5728 c#\u4e2d\u901a\u8fc7 Linq \u53d6\u53d8\u91cf\u7684\u540d\u79f0, \u4ee5\u53ca \u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a\u53d8\u91cf\u540d\uff0c\u901a\u8fc7\u5b57\u7b26\u4e32\u7ed9\u53d8\u91cf\u8d4b\u503c. s &hellip; <a href=\"https:\/\/as32.net\/blog\/8991\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u901a\u8fc7\u52a8\u6001\u5b57\u7b26\u4e32\u83b7\u53d6\u53d8\u91cf\u503c &#038; \u83b7\u53d6\u53d8\u91cf\u540d\u79f0\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4,42,26],"tags":[476,500,597,598],"class_list":["post-8991","post","type-post","status-publish","format-standard","hentry","category-net","category-c-net","category-winform-","category-26","tag-476","tag-500","tag-597","tag-598"],"_links":{"self":[{"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/posts\/8991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/comments?post=8991"}],"version-history":[{"count":0,"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/posts\/8991\/revisions"}],"wp:attachment":[{"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/media?parent=8991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/categories?post=8991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/as32.net\/blog\/wp-json\/wp\/v2\/tags?post=8991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}