{"id":1872,"date":"2026-02-16T17:34:21","date_gmt":"2026-02-16T09:34:21","guid":{"rendered":"http:\/\/www.dxQerp.com\/?p=1872"},"modified":"2026-02-18T08:25:50","modified_gmt":"2026-02-18T00:25:50","slug":"you-said-getprivateprofilesectionnamesa-%e8%88%87-getprivateprofilesectionnamesw-%e5%b7%ae%e5%9c%a8%e5%93%aa%e8%a3%a1","status":"publish","type":"post","link":"http:\/\/www.dxQerp.com\/?p=1872","title":{"rendered":"You said GetPrivateProfileSectionNamesA \u8207 GetPrivateProfileSectionNamesW \u5dee\u5728\u54ea\u88e1 ?"},"content":{"rendered":"<p data-path-to-node=\"0\">\u9019\u5169\u8005\u90fd\u662f Windows API \u4e2d\u7528\u4f86\u8b80\u53d6 <code data-path-to-node=\"0\" data-index-in-node=\"24\">.ini<\/code> \u6a94\u6848\u4e2d\u6240\u6709\u300c\u5340\u6bb5\u540d\u7a31\u300d\uff08Section Names\uff09\u7684\u51fd\u5f0f\u3002<\/p>\n<p data-path-to-node=\"1\">\u5b83\u5011\u7684\u6838\u5fc3\u529f\u80fd\u5b8c\u5168\u76f8\u540c\uff0c\u552f\u4e00\u7684\u5340\u5225\u5728\u65bc <b data-path-to-node=\"1\" data-index-in-node=\"20\">\u5b57\u5143\u7de8\u78bc\uff08Character Encoding\uff09<\/b> \u7684\u8655\u7406\u65b9\u5f0f\u3002<\/p>\n<hr data-path-to-node=\"2\" \/>\n<h3 data-path-to-node=\"3\">1. \u4e3b\u8981\u5dee\u7570\uff1aA \u4ee3\u8868 ANSI\uff0cW \u4ee3\u8868 Wide<\/h3>\n<p data-path-to-node=\"4\">\u9019\u662f\u5728 Windows \u958b\u767c\u4e2d\u975e\u5e38\u5e38\u898b\u7684\u547d\u540d\u6163\u4f8b\uff1a<\/p>\n<ul data-path-to-node=\"5\">\n<li>\n<p data-path-to-node=\"5,0,0\"><b data-path-to-node=\"5,0,0\" data-index-in-node=\"0\"><code data-path-to-node=\"5,0,0\" data-index-in-node=\"0\">GetPrivateProfileSectionNamesA<\/code> (ANSI):<\/b><\/p>\n<ul data-path-to-node=\"5,0,1\">\n<li>\n<p data-path-to-node=\"5,0,1,0,0\">\u4f7f\u7528 <b data-path-to-node=\"5,0,1,0,0\" data-index-in-node=\"3\">8 \u4f4d\u5143<\/b> \u5b57\u5143\u7de8\u78bc\uff08\u901a\u5e38\u662f\u7cfb\u7d71\u7684 Locale \u9801\u78bc\uff0c\u4f8b\u5982 Big5 \u6216 GBK\uff09\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"5,0,1,1,0\">\u9069\u7528\u65bc\u820a\u5f0f\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u6216\u662f\u4e0d\u9700\u8981\u8655\u7406\u591a\u570b\u8a9e\u8a00\u7279\u6b8a\u5b57\u5143\u7684\u5834\u666f\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p data-path-to-node=\"5,1,0\"><b data-path-to-node=\"5,1,0\" data-index-in-node=\"0\"><code data-path-to-node=\"5,1,0\" data-index-in-node=\"0\">GetPrivateProfileSectionNamesW<\/code> (Unicode\/Wide):<\/b><\/p>\n<ul data-path-to-node=\"5,1,1\">\n<li>\n<p data-path-to-node=\"5,1,1,0,0\">\u4f7f\u7528 <b data-path-to-node=\"5,1,1,0,0\" data-index-in-node=\"3\">16 \u4f4d\u5143<\/b> \u7684 UTF-16 \u7de8\u78bc\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"5,1,1,1,0\">\u300cW\u300d\u4ee3\u8868 <b data-path-to-node=\"5,1,1,1,0\" data-index-in-node=\"6\">Wide<\/b>\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"5,1,1,2,0\">\u9019\u624d\u662f\u73fe\u4ee3 Windows \u958b\u767c\u7684\u6a19\u6e96\uff0c\u80fd\u5920\u6b63\u78ba\u8655\u7406\u5404\u7a2e\u8a9e\u8a00\uff08\u5982\u4e2d\u6587\u3001\u65e5\u6587\u3001\u8868\u60c5\u7b26\u865f\u7b49\uff09\uff0c\u907f\u514d\u4e82\u78bc\u554f\u984c\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr data-path-to-node=\"6\" \/>\n<h3 data-path-to-node=\"7\">2. \u904b\u4f5c\u6a5f\u5236\u6bd4\u8f03<\/h3>\n<p data-path-to-node=\"8\">\u5728\u5e95\u5c64\uff0cWindows \u5176\u5be6\u4e3b\u8981\u662f\u4ee5 Unicode (W \u7248) \u904b\u4f5c\u7684\u3002\u5982\u679c\u4f60\u547c\u53eb A \u7248\u672c\u7684\u51fd\u5f0f\uff0c\u7cfb\u7d71\u901a\u5e38\u6703\u9032\u884c\u4ee5\u4e0b\u8f49\u63db\uff1a<\/p>\n<table data-path-to-node=\"9\">\n<thead>\n<tr>\n<td><strong>\u7279\u6027<\/strong><\/td>\n<td><strong>GetPrivateProfileSectionNamesA<\/strong><\/td>\n<td><strong>GetPrivateProfileSectionNamesW<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span data-path-to-node=\"9,1,0,0\"><b data-path-to-node=\"9,1,0,0\" data-index-in-node=\"0\">\u53c3\u6578\u578b\u5225<\/b><\/span><\/td>\n<td><span data-path-to-node=\"9,1,1,0\"><code data-path-to-node=\"9,1,1,0\" data-index-in-node=\"0\">LPSTR<\/code> (char*)<\/span><\/td>\n<td><span data-path-to-node=\"9,1,2,0\"><code data-path-to-node=\"9,1,2,0\" data-index-in-node=\"0\">LPWSTR<\/code> (wchar_t*)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"9,2,0,0\"><b data-path-to-node=\"9,2,0,0\" data-index-in-node=\"0\">\u5b57\u5143\u5927\u5c0f<\/b><\/span><\/td>\n<td><span data-path-to-node=\"9,2,1,0\">1 Byte<\/span><\/td>\n<td><span data-path-to-node=\"9,2,2,0\">2 Bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"9,3,0,0\"><b data-path-to-node=\"9,3,0,0\" data-index-in-node=\"0\">\u6548\u80fd<\/b><\/span><\/td>\n<td><span data-path-to-node=\"9,3,1,0\">\u7565\u4f4e\uff08\u56e0\u70ba\u7cfb\u7d71\u5167\u90e8\u9700\u8f49\u63db\u70ba Unicode\uff09<\/span><\/td>\n<td><span data-path-to-node=\"9,3,2,0\">\u8f03\u9ad8\uff08\u539f\u751f\u652f\u63f4\uff09<\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"9,4,0,0\"><b data-path-to-node=\"9,4,0,0\" data-index-in-node=\"0\">\u76f8\u5bb9\u6027<\/b><\/span><\/td>\n<td><span data-path-to-node=\"9,4,1,0\">\u50c5\u9650\u7279\u5b9a\u8a9e\u8a00\u9801\u78bc<\/span><\/td>\n<td><span data-path-to-node=\"9,4,2,0\">\u5168\u7403\u901a\u7528 (Unicode)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u5169\u8005\u90fd\u662f Windows API \u4e2d\u7528\u4f86\u8b80\u53d6 .ini \u6a94\u6848\u4e2d\u6240\u6709\u300c\u5340\u6bb5\u540d\u7a31\u300d\uff08Section Names\uff09 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[35],"tags":[],"class_list":["post-1872","post","type-post","status-publish","format-standard","hentry","category-_ini"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1872"}],"version-history":[{"count":1,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1872\/revisions"}],"predecessor-version":[{"id":1873,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1872\/revisions\/1873"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}