{"id":4854,"date":"2018-03-25T10:07:37","date_gmt":"2018-03-25T02:07:37","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4854"},"modified":"2018-03-25T10:07:37","modified_gmt":"2018-03-25T02:07:37","slug":"qstringfindswitchvalue-%e5%87%bd%e6%95%b0%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4854","title":{"rendered":"[QString]FindSwitchValue \u51fd\u6570\u4f7f\u7528\u8bf4\u660e"},"content":{"rendered":"<h3>\u3010\u7528\u9014\u3011<\/h3>\n<p>\u6b64\u51fd\u6570\u7528\u4e8e\u5c06\u547d\u4ee4\u884c\u5f00\u5173\u5206\u9694\u4e3a\u4e00\u4e2a\u540d\u79f0-\u503c\u5bf9\uff0c\u5e76\u53d6\u51fa\u5176\u4e2d\u503c\u3002<\/p>\n<h3>\u3010\u58f0\u660e\u3011<\/h3>\n<pre class=\"lang:delphi decode:true\">function FindSwitchValue(ASwitch: QStringW; ANameValueSperator: QCharW;\r\n  AIgnoreCase: Boolean; var ASwitchChar: QCharW): QStringW; overload;\r\nfunction FindSwitchValue(ASwitch: QStringW; ANameValueSperator: QCharW = ':')\r\n  : QStringW;overload;<\/pre>\n<h3>\u3010\u53c2\u6570\u8bf4\u660e\u3011<\/h3>\n<ul>\n<li>ASwitch : \u8981\u67e5\u627e\u7684\u5f00\u5173<\/li>\n<li>ANameValueSperator : \u5f00\u5173\u548c\u540d\u79f0\u7684\u503c\u7684\u5206\u9694\u7b26<\/li>\n<li>AIgnoreCase : \u662f\u5426\u5ffd\u7565\u5927\u5c0f\u5199<\/li>\n<li>ASwitchChar : \u7528\u6237\u8f93\u5165\u7684\u5f00\u5173\u5b57\u7b26\uff0c\u53ef\u80fd\u662f \/\u3001+\u3001- \u4e4b\u4e00<\/li>\n<\/ul>\n<h3>\u3010\u8fd4\u56de\u503c\u3011<\/h3>\n<p style=\"padding-left: 30px;\">\u8fd4\u56de\u5f00\u5173\u5bf9\u5e94\u7684\u503c\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u8fd4\u56de\u7a7a\u5b57\u7b26\u4e32<\/p>\n<h3>\u3010\u5907\u6ce8\u3011<\/h3>\n<p style=\"padding-left: 30px;\">\u91cd\u8f7d\u7684\u7b2c\u4e8c\u4e2a\u7248\u672c\u9ed8\u8ba4\u5ffd\u7565\u5927\u5c0f\u5199\u53ca\u5f00\u5173\u5b57\u7b26<\/p>\n<h3>\u3010\u793a\u4f8b\u3011<\/h3>\n<p>1\u3001\u547d\u4ee4\u884c\u53c2\u6570\uff1a\u00a0xxx.exe \/U:abc -P:8888 +log Price:998<\/p>\n<p>FindSwitchValue(&#8216;u&#8217;) \u00a0-&gt; &#8216;abc&#8217;<\/p>\n<p>FindSwitchValue(&#8216;p&#8217;) -&gt; &#8216;8888&#8217;<\/p>\n<p>FindSwitchValue(&#8216;log&#8217;) -&gt;&#8221;<\/p>\n<p>FindSwitchValue(&#8216;price&#8217;)-&gt;&#8217;998&#8242;<\/p>\n<p>2\u3001\u547d\u4ee4\u884c\u53c2\u6570\uff1axxx.exe &#8211;username=root -P<\/p>\n<p>FindSwitchValue(&#8216;-username&#8217;,&#8217;=&#8217;) -&gt;&#8217;root&#8217;<\/p>\n<p>FindSwitchValue(&#8216;P&#8217;)-&gt;&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u7528\u9014\u3011 \u6b64\u51fd\u6570\u7528\u4e8e\u5c06\u547d\u4ee4\u884c\u5f00\u5173\u5206\u9694\u4e3a\u4e00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[9,603],"tags":[],"class_list":["post-4854","post","type-post","status-publish","format-standard","hentry","category-qdac","category-603"],"views":3585,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4854"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4854\/revisions"}],"predecessor-version":[{"id":4855,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4854\/revisions\/4855"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}