{"id":8679,"date":"2025-04-18T16:52:54","date_gmt":"2025-04-18T08:52:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/8679.html"},"modified":"2025-04-18T16:52:54","modified_gmt":"2025-04-18T08:52:54","slug":"c-%e8%a7%a3%e5%86%b3%e5%9b%a0%e4%b8%ba%e7%ae%97%e6%b3%95%e4%b8%8d%e5%90%8c%ef%bc%8c%e5%ae%a2%e6%88%b7%e7%ab%af%e5%92%8c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%97%a0%e6%b3%95%e9%80%9a%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/8679.html","title":{"rendered":"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90-toc\" style=\"margin-left:40px\">\u6545\u969c\u73b0\u8c61<\/p>\n<p id=\"%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83-toc\" style=\"margin-left:40px\">\u5f00\u53d1\u8fd0\u884c\u73af\u5883<\/p>\n<p id=\"%E8%AE%BE%E8%AE%A1%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:40px\">\u89e3\u51b3<\/p>\n<p id=\"%E5%AE%9E%E7%8E%B0%E6%90%BA%E5%B8%A6%E8%AF%81%E4%B9%A6%E7%9A%84%20API%20URL%E8%B0%83%E7%94%A8-toc\" style=\"margin-left:80px\">\u5b9e\u73b0\u643a\u5e26\u8bc1\u4e66\u7684 API URL\u8c03\u7528<\/p>\n<p id=\"%E5%AF%BC%E5%87%BA%E4%BD%8D%E5%9B%BE%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:40px\">\u5176\u5b83<\/p>\n<hr id=\"hr-toc\" \/>\n<h3 id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90\">\u6545\u969c\u73b0\u8c61<\/h3>\n<p>\u5b9e\u73b0\u5fae\u4fe1\u9000\u6b3e\u529f\u80fd&#xff0c;\u6211\u4eec\u9700\u8981\u5728\u5fae\u4fe1\u652f\u4ed8\u5546\u6237\u540e\u53f0\u7533\u8bf7\u5b89\u5168\u8bc1\u4e66&#xff0c;\u5e76\u8c03\u7528\u9000\u6b3eAPI URL\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u4e3a\u589e\u6dfb\u8fd4\u56de\u8c03\u8bd5\u4fe1\u606f\u5c5e\u6027&#xff0c;\u91cd\u65b0\u5bf9.net FrameWorkd \u7c7b\u5e93\u8fdb\u884c\u7f16\u8bd1\u5e76\u90e8\u7f72&#xff0c;\u8c03\u8bd5\u4e00\u5207\u6b63\u5e38&#xff0c;\u4f46\u518d\u6b21\u8986\u76d6\u7684\u65f6\u5019&#xff0c;\u8c03\u7528\u663e\u793a\u4e3a \u201c \u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c&#xff0c;\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u3002\u201d &#xff0c;\u7cfb\u7edf\u8fd4\u56de\u9519\u8bef&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1077\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085252-680212e44e66d.png\" width=\"1200\" \/><\/p>\n<\/p>\n<p>\u7c7b\u4f3c\u8c03\u7528\u5982\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p>string cert &#061; &#064;&#034;D:\\\\wxpay\\\\apiclient_cert.p12&#034;;<\/p>\n<p>string password &#061; &#034;14302&#034;;<\/p>\n<p>string post_data &#061; getRefundOrderXml(refundorder, key);<br \/>\nstring request_data &#061; PostXmlAndCertToUrl(RefundOrderUrl, post_data,cert,password); <\/p>\n<p>\u95ee\u9898\u51fa\u5728 PostXmlAndCertToUrl \u8c03\u7528\u4e0a&#xff0c;cert \u4e3a\u7533\u8bf7\u8bc1\u4e66\u7684\u5b58\u653e\u4f4d\u7f6e&#xff0c;passwrd \u4e3a\u8bc1\u4e66\u5bc6\u7801\u3002<\/p>\n<\/p>\n<h3 id=\"%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83\">\u5f00\u53d1\u8fd0\u884c\u73af\u5883<\/h3>\n<p>\u64cd\u4f5c\u7cfb\u7edf&#xff1a; Windows Server 2019 DataCenter<\/p>\n<p>.net\u7248\u672c&#xff1a;\u00a0.netFramework4.7.2\u00a0<\/p>\n<p>\u5f00\u53d1\u5de5\u5177&#xff1a;VS2019 \u00a0C#<\/p>\n<h3 id=\"%E8%AE%BE%E8%AE%A1%E5%AE%9E%E7%8E%B0\">\u89e3\u51b3<\/h3>\n<p>System.Net.ServicePointManager.SecurityProtocol \u5c5e\u6027\u53ef\u9009\u62e9\u5b89\u5168\u5957\u63a5\u5b57\u5c42 (SSL) \u6216\u4f20\u8f93\u5c42\u5b89\u5168 (TLS) \u534f\u8bae\u7684\u7248\u672c&#xff0c;\u53ef\u80fd\u662f\u7531\u4e8e\u534f\u8bae\u7248\u672c\u4e0d\u5339\u914d\u9020\u6210\u7684\u6b64\u539f\u56e0&#xff0c;\u901a\u8fc7\u5728Page_Load \u670d\u52a1\u5668\u4e8b\u4ef6\u6dfb\u52a0\u5982\u4e0b\u8bed\u53e5&#xff0c;\u95ee\u9898\u89e3\u51b3&#xff1a;<\/p>\n<p>void Page_Load(Object sender, EventArgs e)<br \/>\n{<br \/>\n     System.Net.ServicePointManager.SecurityProtocol &#061;<br \/>\nSystem.Net.SecurityProtocolType.Tls |<br \/>\nSystem.Net.SecurityProtocolType.Tls11 |<br \/>\nSystem.Net.SecurityProtocolType.Tls12;<\/p>\n<p>}   <\/p>\n<h4 id=\"%E5%AE%9E%E7%8E%B0%E6%90%BA%E5%B8%A6%E8%AF%81%E4%B9%A6%E7%9A%84%20API%20URL%E8%B0%83%E7%94%A8\">\u5b9e\u73b0\u643a\u5e26\u8bc1\u4e66\u7684 API URL\u8c03\u7528<\/h4>\n<p>PostXmlAndCertToUrl \u5b9e\u73b0\u4e86\u643a\u5e26\u5b89\u5168\u8bc1\u4e66\u8bbf\u95ee API \u7684\u80fd\u529b&#xff0c;\u8bf4\u660e\u89c1\u4e0b\u8868&#xff1a;<\/p>\n<table align=\"center\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">\n<tr>\u5e8f\u53f7\u53c2\u6570\u540d\u7c7b\u578b\u8bf4\u660e<\/tr>\n<tbody>\n<tr>1<\/p>\n<td style=\"text-align:center;width:98px\">url<\/td>\n<td style=\"text-align:center;width:77px\">string<\/td>\n<td style=\"width:461px\">\u8981\u8bbf\u95ee\u7684 API URL \u5730\u5740<\/td>\n<\/tr>\n<tr>2<\/p>\n<td style=\"text-align:center;width:98px\">post_data<\/td>\n<td style=\"text-align:center;width:77px\">string<\/td>\n<td style=\"width:461px\">\u8981 POST \u7684\u6307\u5b9a\u89c4\u5219\u5185\u5bb9\u00a0<\/td>\n<\/tr>\n<tr>3<\/p>\n<td style=\"text-align:center;width:98px\">cert<\/td>\n<td style=\"text-align:center;width:77px\">string<\/td>\n<td style=\"width:461px\">API \u5b89\u5168\u8bc1\u4e66\u5b58\u653e\u5b58\u50a8\u7684\u5168\u8def\u5f84\u5730\u5740<\/td>\n<\/tr>\n<tr>4<\/p>\n<td style=\"text-align:center;width:98px\">password<\/td>\n<td style=\"text-align:center;width:77px\">string<\/td>\n<td style=\"width:461px\">\u8bc1\u4e66\u5bc6\u7801<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>public string PostXmlAndCertToUrl(string url, string postData,string cert,string password)<br \/>\n{<br \/>\n     string resp &#061; string.Empty;<br \/>\n     ServicePointManager.ServerCertificateValidationCallback &#061; new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);<br \/>\nSystem.Security.Cryptography.X509Certificates.X509Certificate2 cer &#061; new System.Security.Cryptography.X509Certificates.X509Certificate2(cert, password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.PersistKeySet | System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.MachineKeySet);<\/p>\n<p>     HttpWebRequest webrequest &#061; (HttpWebRequest)HttpWebRequest.Create(url);<br \/>\n     webrequest.ClientCertificates.Add(cer);<br \/>\n     webrequest.Method &#061; &#034;post&#034;;<br \/>\n     webrequest.ContentType &#061; &#034;application\/x-www-form-urlencoded&#034;;<br \/>\n     webrequest.ContentLength &#061; postData.Length;<br \/>\n     HttpWebResponse response &#061; null;<br \/>\n     try<br \/>\n     {<br \/>\n        StreamWriter swRequestWriter &#061; new StreamWriter(webrequest.GetRequestStream());<br \/>\n        swRequestWriter.Write(postData);<\/p>\n<p>        if (swRequestWriter !&#061; null)<br \/>\n            swRequestWriter.Close();<\/p>\n<p>            response &#061; (HttpWebResponse)webrequest.GetResponse();<br \/>\n            using (StreamReader reader &#061; new StreamReader(response.GetResponseStream(), Encoding.UTF8))<br \/>\n            {<br \/>\n              resp &#061; reader.ReadToEnd();<br \/>\n            }<br \/>\n     }<br \/>\n     catch (Exception exp)<br \/>\n     {<br \/>\n           throw exp;<\/p>\n<p>     }<br \/>\n     finally<br \/>\n     {<br \/>\n           if (response !&#061; null)<br \/>\n               response.Close();<br \/>\n     }<br \/>\n     return resp;<br \/>\n}<\/p>\n<p>private static bool CheckValidationResult(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors errors)<br \/>\n{<br \/>\n       if (errors &#061;&#061; System.Net.Security.SslPolicyErrors.None)<br \/>\n           return true;<br \/>\n       return false;<br \/>\n} <\/p>\n<h3 id=\"%E5%AF%BC%E5%87%BA%E4%BD%8D%E5%9B%BE%E6%95%B0%E6%8D%AE\">\u5176\u5b83<\/h3>\n<p>\u5173\u4e8e\u5fae\u4fe1\u652f\u4ed8\u7533\u8bf7\u7684API\u8bc1\u4e66\u4e00\u822c\u6709\u6548\u671f\u4e3a5\u5e74&#xff0c;\u6700\u591a\u53ef\u540c\u65f6\u7533\u8bf79\u4e2a\u8bc1\u4e66&#xff0c;\u8bf7\u6ce8\u610f\u8bc1\u4e66\u7684\u66f4\u65b0\u3002\u5176\u5b83\u53ef\u53c2\u9605\u6211\u7684\u6587\u7ae0<\/p>\n<p>\u300aC# \u5b9e\u73b0\u5fae\u4fe1\u9000\u6b3e\u53ca\u5bf9\u5e10\u300b<\/p>\n<p>\u300aC# \u89e3\u51b3\u8bbf\u95ee API \u663e\u793a\u57fa\u7840\u8fde\u63a5\u5df2\u7ecf\u5173\u95ed\u7684\u95ee\u9898\u300b<\/p>\n<p>\u5982\u679c\u5bf9\u4e8e\u53ef\u76f4\u63a5\u8bbf\u95ee\u7684 API URL &#xff0c;\u53ef\u53c2\u9605\u6211\u7684\u6587\u7ae0&#xff1a;<\/p>\n<p>\u300aC# \u5173\u4e8e\u201c\u60a8\u4e0e\u8be5\u7f51\u7ad9\u7684\u8fde\u63a5\u4e0d\u662f\u79c1\u5bc6\u8fde\u63a5&#8230;\u201d\u7684\u95ee\u9898\u300b<\/p>\n<p>\u300aC# \u5b9e\u73b0\u8bbf\u95ee Web API Url \u63d0\u4ea4\u6570\u636e\u5e76\u83b7\u53d6\u5904\u7406\u7ed3\u679c\u300b<\/p>\n<\/p>\n<p>\u611f\u8c22\u60a8\u7684\u9605\u8bfb&#xff0c;\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6k\u6b21\uff0c\u70b9\u8d5e163\u6b21\uff0c\u6536\u85cf155\u6b21\u3002\u5b9e\u73b0\u5fae\u4fe1\u9000\u6b3e\u529f\u80fd\uff0c\u6211\u4eec\u9700\u8981\u5728\u5fae\u4fe1\u652f\u4ed8\u5546\u6237\u540e\u53f0\u7533\u8bf7\u5b89\u5168\u8bc1\u4e66\uff0c\u5e76\u8c03\u7528\u9000\u6b3eAPI URL\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u4e3a\u589e\u6dfb\u8fd4\u56de\u8c03\u8bd5\u4fe1\u606f\u5c5e\u6027\uff0c\u91cd\u65b0\u5bf9.net FrameWorkd \u7c7b\u5e93\u8fdb\u884c\u7f16\u8bd1\u5e76\u90e8\u7f72\uff0c\u8c03\u8bd5\u4e00\u5207\u6b63\u5e38\uff0c\u4f46\u518d\u6b21\u8986\u76d6\u7684\u65f6\u5019\uff0c\u8c03\u7528\u663e\u793a\u4e3a \u201c \u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u3002\u201d _\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c,\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1<\/p>\n","protected":false},"author":2,"featured_media":8678,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[189,55,190,43,191,122],"topic":[],"class_list":["post-8679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c-","tag-c","tag-190","tag-43","tag-191","tag-122"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/8679.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6k\u6b21\uff0c\u70b9\u8d5e163\u6b21\uff0c\u6536\u85cf155\u6b21\u3002\u5b9e\u73b0\u5fae\u4fe1\u9000\u6b3e\u529f\u80fd\uff0c\u6211\u4eec\u9700\u8981\u5728\u5fae\u4fe1\u652f\u4ed8\u5546\u6237\u540e\u53f0\u7533\u8bf7\u5b89\u5168\u8bc1\u4e66\uff0c\u5e76\u8c03\u7528\u9000\u6b3eAPI URL\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u4e3a\u589e\u6dfb\u8fd4\u56de\u8c03\u8bd5\u4fe1\u606f\u5c5e\u6027\uff0c\u91cd\u65b0\u5bf9.net FrameWorkd \u7c7b\u5e93\u8fdb\u884c\u7f16\u8bd1\u5e76\u90e8\u7f72\uff0c\u8c03\u8bd5\u4e00\u5207\u6b63\u5e38\uff0c\u4f46\u518d\u6b21\u8986\u76d6\u7684\u65f6\u5019\uff0c\u8c03\u7528\u663e\u793a\u4e3a \u201c \u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u3002\u201d _\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c,\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/8679.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T08:52:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085252-680212e44e66d.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8679.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/8679.html\",\"name\":\"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T08:52:54+00:00\",\"dateModified\":\"2025-04-18T08:52:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/8679.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/8679.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8679.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/8679.html","og_locale":"zh_CN","og_type":"article","og_title":"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6k\u6b21\uff0c\u70b9\u8d5e163\u6b21\uff0c\u6536\u85cf155\u6b21\u3002\u5b9e\u73b0\u5fae\u4fe1\u9000\u6b3e\u529f\u80fd\uff0c\u6211\u4eec\u9700\u8981\u5728\u5fae\u4fe1\u652f\u4ed8\u5546\u6237\u540e\u53f0\u7533\u8bf7\u5b89\u5168\u8bc1\u4e66\uff0c\u5e76\u8c03\u7528\u9000\u6b3eAPI URL\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u4e3a\u589e\u6dfb\u8fd4\u56de\u8c03\u8bd5\u4fe1\u606f\u5c5e\u6027\uff0c\u91cd\u65b0\u5bf9.net FrameWorkd \u7c7b\u5e93\u8fdb\u884c\u7f16\u8bd1\u5e76\u90e8\u7f72\uff0c\u8c03\u8bd5\u4e00\u5207\u6b63\u5e38\uff0c\u4f46\u518d\u6b21\u8986\u76d6\u7684\u65f6\u5019\uff0c\u8c03\u7528\u663e\u793a\u4e3a \u201c \u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u3002\u201d _\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c,\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1","og_url":"https:\/\/www.wsisp.com\/helps\/8679.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T08:52:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085252-680212e44e66d.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/8679.html","url":"https:\/\/www.wsisp.com\/helps\/8679.html","name":"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T08:52:54+00:00","dateModified":"2025-04-18T08:52:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/8679.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/8679.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/8679.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C# \u89e3\u51b3\u201c\u56e0\u4e3a\u7b97\u6cd5\u4e0d\u540c\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u65e0\u6cd5\u901a\u4fe1\u201d\u7684\u95ee\u9898"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/8679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=8679"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/8679\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/8678"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=8679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=8679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=8679"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=8679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}