{"id":58480,"date":"2025-08-16T11:25:12","date_gmt":"2025-08-16T03:25:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58480.html"},"modified":"2025-08-16T11:25:12","modified_gmt":"2025-08-16T03:25:12","slug":"%e5%bc%80%e6%ba%90-arkts-%e9%b8%bf%e8%92%99%e5%ba%94%e7%94%a8-%e5%bc%80%e5%8f%91%ef%bc%88%e5%8d%81%e4%b8%83%ef%bc%89%e9%80%9a%e8%ae%af-http%e5%a4%9a%e6%96%87%e4%bb%b6%e4%b8%8b%e8%bd%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58480.html","title":{"rendered":"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf--http\u591a\u6587\u4ef6\u4e0b\u8f7d"},"content":{"rendered":"<p>\u00a0\u6587\u7ae0\u7684\u76ee\u7684\u4e3a\u4e86\u8bb0\u5f55\u4f7f\u7528Arkts\u00a0\u8fdb\u884cHarmony\u00a0app\u00a0\u5f00\u53d1\u5b66\u4e60\u7684\u7ecf\u5386\u3002\u672c\u804c\u4e3a\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1&#xff0c;\u516c\u53f8\u5b89\u6392\u5f00\u53d1app&#xff0c;\u4e34\u65f6\u5b66\u4e60&#xff0c;\u5b8c\u6210app\u7684\u5f00\u53d1\u3002\u5f00\u53d1\u6d41\u7a0b\u548c\u8981\u70b9\u6709\u4e9b\u8bb0\u5fc6\u6a21\u7cca&#xff0c;\u8d76\u7d27\u8bb0\u5f55&#xff0c;\u9632\u6b62\u5fd8\u8bb0\u3002<\/p>\n<p>\u00a0\u76f8\u5173\u94fe\u63a5&#xff1a;<\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e00&#xff09;\u5de5\u7a0b\u6587\u4ef6\u5206\u6790-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e8c&#xff09;\u5c01\u88c5\u5e93.har\u5236\u4f5c\u548c\u5e94\u7528-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e09&#xff09;Arkts\u7684\u4ecb\u7ecd-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u56db&#xff09;\u5e03\u5c40\u548c\u5e38\u7528\u63a7\u4ef6-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e94&#xff09;\u63a7\u4ef6\u7ec4\u6210\u548c\u590d\u6742\u63a7\u4ef6-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u516d&#xff09;\u6570\u636e\u6301\u4e45&#8211;\u6587\u4ef6\u548c\u9996\u9009\u9879\u5b58\u50a8-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e03&#xff09;\u6570\u636e\u6301\u4e45&#8211;sqlite\u5173\u7cfb\u6570\u636e\u5e93-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u516b&#xff09;\u591a\u5a92\u4f53&#8211;\u76f8\u518c\u548c\u76f8\u673a-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u4e5d&#xff09;\u901a\u8baf&#8211;tcp\u5ba2\u6237\u7aef-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341&#xff09;\u901a\u8baf&#8211;Http-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u4e00&#xff09;\u8bc1\u4e66\u548c\u5305\u540d\u4fee\u6539-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u4e8c&#xff09;\u4f20\u611f\u5668\u7684\u4f7f\u7528-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u4e09&#xff09;\u97f3\u9891&#8211;MP3\u64ad\u653e_arkts avplayer\u64ad\u653e\u97f3\u9891 mp3-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u56db&#xff09;\u7ebf\u7a0b&#8211;\u4efb\u52a1\u6c60(taskpool)-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u4e94&#xff09;\u81ea\u5b9a\u4e49\u7ed8\u56fe\u63a7\u4ef6&#8211;\u4eea\u8868\u76d8-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u516d&#xff09;\u81ea\u5b9a\u4e49\u7ed8\u56fe\u63a7\u4ef6&#8211;\u6ce2\u5f62\u56fe-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u4e03&#xff09;\u901a\u8baf&#8211;http\u591a\u6587\u4ef6\u4e0b\u8f7d-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1&#xff08;\u5341\u516b&#xff09;\u901a\u8baf&#8211;Ble\u4f4e\u529f\u8017\u84dd\u7259\u670d\u52a1\u5668-CSDN\u535a\u5ba2<\/span><\/p>\n<p>\u00a0\u63a8\u8350\u94fe\u63a5&#xff1a;<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e00&#xff09;\u5f00\u53d1\u73af\u5883\u7684\u642d\u5efa-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e8c&#xff09;\u5de5\u7a0b\u6587\u4ef6\u7ed3\u6784-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e09&#xff09;GUI\u754c\u9762\u5e03\u5c40\u548c\u5e38\u7528\u7ec4\u4ef6-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u56db&#xff09;GUI\u754c\u9762\u91cd\u8981\u7ec4\u4ef6-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e94&#xff09;\u6587\u4ef6\u548c\u6570\u636e\u5e93\u5b58\u50a8-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u516d&#xff09;\u591a\u5a92\u4f53\u4f7f\u7528-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e03&#xff09;\u901a\u8baf\u4e4bTcp\u548cHttp-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u516b&#xff09;\u901a\u8baf\u4e4bMqtt\u548cBle-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u4e5d&#xff09;\u540e\u53f0\u4e4b\u7ebf\u7a0b\u548c\u670d\u52a1-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u5341&#xff09;\u5e7f\u64ad\u673a\u5236-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u5341\u4e00&#xff09;\u8c03\u8bd5\u3001\u53d1\u5e03-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 java android app \u5f00\u53d1&#xff08;\u5341\u4e8c&#xff09;\u5c01\u5e93.aar-CSDN\u535a\u5ba2<\/p>\n<p>\u63a8\u8350\u94fe\u63a5&#xff1a;<\/p>\n<p>\u5f00\u6e90C# .net mvc \u5f00\u53d1&#xff08;\u4e00&#xff09;WEB\u642d\u5efa_c#\u90e8\u7f72web\u7a0b\u5e8f-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 C# .net mvc \u5f00\u53d1&#xff08;\u4e8c&#xff09;\u7f51\u7ad9\u5feb\u901f\u642d\u5efa_c#\u7f51\u7ad9\u5f00\u53d1-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 C# .net mvc \u5f00\u53d1&#xff08;\u4e09&#xff09;WEB\u5185\u5916\u7f51\u8bbf\u95ee(VS\u53d1\u5e03\u3001IIS\u914d\u7f6e\u7f51\u7ad9\u3001\u82b1\u751f\u58f3\u5916\u7f51\u7a7f\u523a\u8bbf\u95ee)_c# mvc \u57df\u540d\u4e0b\u4e0d\u53ef\u8a2a\u554f\u5167\u7db2,\u5167\u7db2\u4e0b\u53ef\u4ee5\u8a2a\u554f\u57df\u540d-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 C# .net mvc \u5f00\u53d1&#xff08;\u56db&#xff09;\u5de5\u7a0b\u7ed3\u6784\u3001\u9875\u9762\u63d0\u4ea4\u4ee5\u53ca\u663e\u793a_c#\u5de5\u7a0b\u7ed3\u6784-CSDN\u535a\u5ba2<\/p>\n<p>\u5f00\u6e90 C# .net mvc \u5f00\u53d1&#xff08;\u4e94&#xff09;\u5e38\u7528\u4ee3\u7801\u5feb\u901f\u5f00\u53d1_c# mvc\u5f00\u53d1-CSDN\u535a\u5ba2<\/p>\n<\/p>\n<p>\u672c\u7ae0\u5185\u5bb9\u4e3b\u8981\u6f14\u793a\u4e86\u4e00\u4e2a\u591a\u6587\u4ef6\u4e0b\u8f7d\u7684HarmonyOS\u5e94\u7528\u754c\u9762&#xff0c;\u4e3b\u8981\u5305\u542b\u4e09\u4e2a\u90e8\u5206&#xff1a;MultipleFilesDownload\u4e3b\u7ec4\u4ef6\u3001FileDownloadItem\u4e0b\u8f7d\u9879\u7ec4\u4ef6\u548cProgressButton\u8fdb\u5ea6\u6309\u94ae\u7ec4\u4ef6\u3002<\/p>\n<\/p>\n<p>1.\u5de5\u7a0b\u7ed3\u6784<\/p>\n<p>2.\u6e90\u7801\u89e3\u6790<\/p>\n<p>3.\u6f14\u793a\u6548\u679c<\/p>\n<p>4.\u5de5\u7a0b\u4e0b\u8f7d\u7f51\u5740<\/p>\n<\/p>\n<p>\u4e00\u3001\u5de5\u7a0b\u7ed3\u6784&#xff0c;\u4e3b\u8981\u5305\u62ec3\u4e2a\u6587\u4ef6&#xff0c;Index.ets,FileDownloadItem.ets,ProgressButton.ets\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"851\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816032507-689ffa1362c6d.png\" width=\"1535\" \/>\u200b<\/p>\n<\/p>\n<p>\u4e8c\u3001\u6e90\u7801\u89e3\u6790<\/p>\n<p>2.1\u00a0 Index.ets\u6587\u4ef6&#xff1a;\u7ba1\u7406\u591a\u4e2a\u6587\u4ef6\u7684\u4e0b\u8f7d\u4efb\u52a1&#xff0c;\u63d0\u4f9b&#034;\u5168\u90e8\u5f00\u59cb\/\u6682\u505c&#034;\u529f\u80fd&#xff0c;\u663e\u793a\u4e0b\u8f7d\u5217\u8868\u3002<\/p>\n<p>\u7b80\u5355\u8bf4\u660e&#xff1a;<\/p>\n<p>\u4f7f\u7528&#064;Entry\u548c&#064;Component\u88c5\u9970\u5668\u58f0\u660e\u4e3a\u5165\u53e3\u7ec4\u4ef6&#xff0c;<\/p>\n<p>\u7ef4\u62a4\u4e00\u4e2a\u4e0b\u8f7dURL\u6570\u7ec4downloadUrlArray<\/p>\n<p>\u4f7f\u7528ForEach\u6e32\u67d3\u591a\u4e2aFileDownloadItem\u7ec4\u4ef6<\/p>\n<p>\u63d0\u4f9b\u5168\u5c40\u7684\u5f00\u59cb\/\u6682\u505c\u6240\u6709\u4e0b\u8f7d\u7684\u529f\u80fd<\/p>\n<p>\u8ddf\u8e2a\u4e0b\u8f7d\u8ba1\u6570\u548c\u5931\u8d25\u8ba1\u6570<\/p>\n<\/p>\n<p>\u4ee5\u4e0b\u4e3a\u4ee3\u7801&#xff1a;<\/p>\n<p>import { request } from &#039;&#064;kit.BasicServicesKit&#039;;<br \/>\nimport { FileDownloadItem } from &#039;..\/view\/FileDownloadItem&#039;;<\/p>\n<p>const NO_TASK: number &#061; 0;<\/p>\n<p>function downloadConfig(downloadUrl: string): request.agent.Config {<br \/>\n  const config: request.agent.Config &#061; {<br \/>\n    action: request.agent.Action.DOWNLOAD,<br \/>\n    url: downloadUrl,<br \/>\n    overwrite: true,<br \/>\n    method: &#039;GET&#039;,<br \/>\n    saveas: &#039;.\/&#039;,<br \/>\n    mode: request.agent.Mode.BACKGROUND,<br \/>\n    gauge: true,<br \/>\n    retry: false<br \/>\n  };<br \/>\n  return config;<br \/>\n}<\/p>\n<p>&#064;Entry<br \/>\n&#064;Component<br \/>\nstruct MultipleFilesDownload {<br \/>\n  \/**<br \/>\n   * enter the download urls<br \/>\n   *\/<br \/>\n  private downloadUrlArray: string[] &#061; [&#034;https:\/\/m.down.sandai.net\/mobile\/OfficialSite_MobileThunder1.apk&#034;];<br \/>\n  &#064;State downloadConfigArray: request.agent.Config[] &#061; [];<br \/>\n  &#064;State isStartAllDownload: boolean &#061; false;<br \/>\n  &#064;State downloadCount: number &#061; 0;<br \/>\n  &#064;State downloadFailCount: number &#061; 0;<\/p>\n<p>  aboutToAppear(): void {<br \/>\n    for (let i &#061; 0; i &lt; this.downloadUrlArray.length; i&#043;&#043;) {<br \/>\n      const config: request.agent.Config &#061; downloadConfig(this.downloadUrlArray[i]);<br \/>\n      this.downloadConfigArray.push(config);<br \/>\n    }<br \/>\n    this.downloadCount &#061; this.downloadUrlArray.length;<br \/>\n  }<\/p>\n<p>  build() {<br \/>\n    Column() {<br \/>\n      Row() {<br \/>\n        Text($r(&#039;app.string.multiple_files_download_transfer_list&#039;))<br \/>\n          .fontWeight(FontWeight.Bold)<br \/>\n          .fontSize($r(&#039;app.integer.title_font_size&#039;))<br \/>\n          .width(&#039;100%&#039;)<br \/>\n          .fontColor($r(&#039;app.color.text_color&#039;))<br \/>\n      }<br \/>\n      .alignItems(VerticalAlign.Bottom)<br \/>\n      .width(&#039;91.1%&#039;)<br \/>\n      .height(112)<\/p>\n<p>      Row() {<br \/>\n        Row() {<br \/>\n          Text($r(&#039;app.string.multiple_files_download_queue&#039;))<br \/>\n            .fontSize($r(&#039;app.integer.multiple_files_download_text_font_size_fourteen&#039;))<br \/>\n            .fontColor($r(&#039;sys.color.ohos_id_color_text_secondary&#039;))<br \/>\n        }.width($r(&#039;app.string.multiple_files_download_row_width&#039;))<\/p>\n<p>        Row() {<br \/>\n          Text(this.isStartAllDownload &amp;&amp; this.downloadCount &gt; NO_TASK ? $r(&#039;app.string.pause_all&#039;) :<br \/>\n          $r(&#039;app.string.start_all&#039;))<br \/>\n            .fontSize($r(&#039;app.integer.multiple_files_download_text_font_size_fourteen&#039;))<br \/>\n            .fontWeight(500)<br \/>\n            .fontColor($r(&#039;sys.color.ohos_id_color_text_primary_activated&#039;))<br \/>\n            .textAlign(TextAlign.End)<br \/>\n            .width($r(&#039;app.string.multiple_files_download_row_text_width&#039;))<br \/>\n            .onClick(() &#061;&gt; {<br \/>\n              if (this.downloadCount &#061;&#061;&#061; NO_TASK) {<br \/>\n                this.getUIContext().showAlertDialog({<br \/>\n                  message: $r(&#039;app.string.multiple_files_download_completed&#039;),<br \/>\n                  alignment: DialogAlignment.Center<br \/>\n                });<br \/>\n                return;<br \/>\n              }<br \/>\n              this.isStartAllDownload &#061; !this.isStartAllDownload;<br \/>\n            })<br \/>\n        }.width($r(&#039;app.string.multiple_files_download_row_width&#039;))<br \/>\n      }<br \/>\n      .margin({<br \/>\n        left: 16,<br \/>\n        right: 16,<br \/>\n        top: $r(&#039;app.integer.multiple_files_download_margin_top_twenty_eight&#039;),<br \/>\n        bottom: $r(&#039;app.integer.margin_eight&#039;)<br \/>\n      })<\/p>\n<p>      List() {<br \/>\n        ForEach(this.downloadConfigArray, (item: request.agent.Config) &#061;&gt; {<br \/>\n          ListItem() {<br \/>\n            FileDownloadItem({<br \/>\n              downloadConfig: item,<br \/>\n              isStartAllDownload: this.isStartAllDownload,<br \/>\n              downloadCount: this.downloadCount,<br \/>\n              downloadFailCount: this.downloadFailCount<br \/>\n            })<br \/>\n          }<br \/>\n        }, (item: request.agent.Config) &#061;&gt; JSON.stringify(item))<br \/>\n      }<br \/>\n      .width(&#039;100%&#039;)<br \/>\n      .height(&#039;100%&#039;)<br \/>\n    }<br \/>\n    .focusable(false)<br \/>\n  }<br \/>\n}<\/p>\n<p>&#064;Builder<br \/>\nexport function getMultipleFilesDownload(): void {<br \/>\n  MultipleFilesDownload();<br \/>\n} <\/p>\n<p>2.2\u00a0\u00a0FileDownloadItem.ets\u7ec4\u4ef6&#xff1a;\u663e\u793a\u6587\u4ef6\u540d\u3001\u4e0b\u8f7d\u8fdb\u5ea6\u548c\u72b6\u6001&#xff0c;\u63d0\u4f9b\u6682\u505c\/\u7ee7\u7eed\u4e0b\u8f7d\u529f\u80fd&#xff0c;\u5904\u7406\u4e0b\u8f7d\u8fc7\u7a0b\u4e2d\u7684\u5404\u79cd\u56de\u8c03\u3002<\/p>\n<p>\u7b80\u5355\u8bf4\u660e&#xff1a;<\/p>\n<p>completedCallback: \u4e0b\u8f7d\u5b8c\u6210<\/p>\n<p>failedCallback: \u4e0b\u8f7d\u5931\u8d25<\/p>\n<p>pauseCallback: \u6682\u505c\u4e0b\u8f7d<\/p>\n<p>resumeCallback: \u7ee7\u7eed\u4e0b\u8f7d<\/p>\n<p>progressCallback: \u4e0b\u8f7d\u8fdb\u5ea6\u66f4\u65b0<\/p>\n<p>responseCallback: HTTP\u54cd\u5e94<\/p>\n<p>\u4f7f\u7528ProgressButton\u7ec4\u4ef6\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u548c\u63a7\u5236\u6309\u94ae<\/p>\n<p>\u5904\u7406\u6587\u4ef6\u5927\u5c0f\u548c\u4e0b\u8f7d\u8fdb\u5ea6\u7684\u663e\u793a\u8f6c\u6362<\/p>\n<\/p>\n<p>import { common } from &#039;&#064;kit.AbilityKit&#039;;<br \/>\nimport { request } from &#039;&#064;kit.BasicServicesKit&#039;;<br \/>\nimport { hilog } from &#039;&#064;kit.PerformanceAnalysisKit&#039;;<\/p>\n<p>import { ProgressButton } from &#039;.\/ProgressButton&#039;;<\/p>\n<p>const uiContext: UIContext | undefined &#061; AppStorage.get(&#039;uiContext&#039;);<\/p>\n<p>const TAG &#061; &#039;FileDownloadItem&#039;;<br \/>\nconst BYTE_CONVERSION: number &#061; 1024;<br \/>\nconst context &#061; uiContext!.getHostContext()! as common.UIAbilityContext;<\/p>\n<p>function getFileNameFromUrl(url: string): string {<br \/>\n  const segments &#061; url.split(&#039;\/&#039;);<br \/>\n  let tmp &#061; segments.pop() || &#039;&#039;;<br \/>\n  if (tmp.indexOf(&#039;?&#039;) !&#061; -1) {<br \/>\n    return tmp.split(&#039;?&#039;)[0];<br \/>\n  }<br \/>\n  return tmp;<br \/>\n}<\/p>\n<p>&#064;Component<br \/>\nexport struct FileDownloadItem {<br \/>\n  &#064;State downloadConfig: request.agent.Config &#061; { action: request.agent.Action.DOWNLOAD, url: &#039;&#039; };<br \/>\n  &#064;State fileName: string &#061; &#039;&#039;;<br \/>\n  &#064;State textState: string | Resource &#061; &#034;&#034;;<br \/>\n  &#064;Link &#064;Watch(&#039;onDownLoadUpdated&#039;) isStartAllDownload: boolean;<br \/>\n  private downloadTask: request.agent.Task | undefined &#061; undefined;<br \/>\n  &#064;Link downloadCount: number;<br \/>\n  &#064;Link downloadFailCount: number;<br \/>\n  &#064;State isShow: boolean &#061; false;<br \/>\n  &#064;State downloading: boolean &#061; false;<br \/>\n  &#064;State sFileSize: string | number &#061; &#034;-&#034;;<br \/>\n  &#064;State nFileSize: number &#061; 0;<br \/>\n  &#064;State sCurrentDownloadSize: string &#061; &#034;-&#034;;<br \/>\n  &#064;State &#064;Watch(&#039;updateProgress&#039;) nCurrentDownloadSize: number &#061; 0;<br \/>\n  &#064;State progress: number &#061; 0;<br \/>\n  &#064;State isPaused: boolean &#061; false;<br \/>\n  private completedCallback &#061; (progress: request.agent.Progress) &#061;&gt; {<br \/>\n    this.textState &#061; $r(&#034;app.string.download_completed&#034;);<br \/>\n    if (this.sFileSize &#061;&#061;&#061; -1) {<br \/>\n      this.sFileSize &#061; this.sCurrentDownloadSize<br \/>\n      this.nCurrentDownloadSize &#061; 1;<br \/>\n    }<br \/>\n    this.downloadCount&#8211;;<br \/>\n  }<br \/>\n  private failedCallback &#061; (progress: request.agent.Progress) &#061;&gt; {<br \/>\n    this.textState &#061; $r(&#034;app.string.download_fail&#034;);<br \/>\n    this.downloadFailCount&#043;&#043;;<br \/>\n    if (this.downloadFailCount &#061;&#061;&#061; this.downloadCount) {<br \/>\n      this.isStartAllDownload &#061; false;<br \/>\n    }<br \/>\n    if (this.downloadTask) {<br \/>\n      request.agent.show(this.downloadTask.tid, (err: Error, taskInfo: request.agent.TaskInfo) &#061;&gt; {<br \/>\n        if (err) {<br \/>\n          hilog.error(0x0000, TAG, &#039;agent show error:&#039;, err);<br \/>\n          return;<br \/>\n        }<br \/>\n      });<br \/>\n    }<br \/>\n  }<br \/>\n  private pauseCallback &#061; (progress: request.agent.Progress) &#061;&gt; {<br \/>\n    this.isPaused &#061; true;<br \/>\n    this.downloading &#061; false;<br \/>\n    this.textState &#061; $r(&#034;app.string.paused&#034;);<br \/>\n  }<br \/>\n  private resumeCallback &#061; (progress: request.agent.Progress) &#061;&gt; {<br \/>\n    this.isPaused &#061; false;<br \/>\n    this.textState &#061; $r(&#034;app.string.downloading&#034;);<br \/>\n    this.downloading &#061; true;<br \/>\n  }<br \/>\n  private progressCallback &#061; (progress: request.agent.Progress) &#061;&gt; {<br \/>\n    this.textState &#061; $r(&#034;app.string.downloading&#034;);<br \/>\n    this.downloading &#061; true;<br \/>\n    this.isShow &#061; true;<br \/>\n    if (this.downloadTask) {<br \/>\n      if (this.sFileSize &#061;&#061;&#061; &#039;-&#039;) {<br \/>\n        if (progress.sizes[0] &#061;&#061;&#061; -1) {<br \/>\n          this.sFileSize &#061; -1;<br \/>\n          this.nCurrentDownloadSize &#061; 0;<br \/>\n          this.nFileSize &#061; 1;<br \/>\n        } else {<br \/>\n          this.nFileSize &#061; progress.sizes[0];<br \/>\n          this.sFileSize &#061; (progress.sizes[0] \/ BYTE_CONVERSION).toFixed() &#043; &#039;kb&#039;;<br \/>\n          this.nCurrentDownloadSize &#061; progress.processed;<br \/>\n        }<br \/>\n      } else if (this.sFileSize &#061;&#061;&#061; -1) {<br \/>\n        hilog.info(0x0000, TAG, &#039;file size unknown&#039;);<br \/>\n      } else {<br \/>\n        this.nCurrentDownloadSize &#061; progress.processed;<br \/>\n      }<br \/>\n      this.sCurrentDownloadSize &#061; (progress.processed \/ BYTE_CONVERSION).toFixed() &#043; &#039;kb&#039;;<br \/>\n    }<br \/>\n  }<br \/>\n  private responseCallback &#061; (response: request.agent.HttpResponse) &#061;&gt; {<br \/>\n    hilog.info(0x0000, TAG, &#039;response:&#039; &#043; response.statusCode);<br \/>\n  };<\/p>\n<p>  updateProgress() {<br \/>\n    setTimeout(() &#061;&gt; {<br \/>\n      if (this.textState &#061;&#061; $r(&#034;app.string.paused&#034;)) {<br \/>\n        this.isPaused &#061; true;<br \/>\n        return;<br \/>\n      }<br \/>\n      let tmp &#061; this.nCurrentDownloadSize \/ this.nFileSize * 100;<br \/>\n      if (tmp &lt;&#061; this.progress) {<br \/>\n        return;<br \/>\n      }<br \/>\n      this.progress &#061; tmp;<br \/>\n    }, 10)<br \/>\n  }<\/p>\n<p>  aboutToAppear(): void {<br \/>\n    this.fileName &#061; getFileNameFromUrl(this.downloadConfig.url);<br \/>\n  }<\/p>\n<p>  onDownLoadUpdated(): void {<br \/>\n    if (this.isStartAllDownload) {<br \/>\n      if (this.textState &#061;&#061;&#061; $r(&#034;app.string.download_fail&#034;)) {<br \/>\n        this.downloadTask &#061; undefined;<br \/>\n        this.isShow &#061; false;<br \/>\n        this.textState &#061; &#034;&#034;;<br \/>\n      }<br \/>\n      this.startDownload();<br \/>\n    } else {<br \/>\n      if (this.downloadFailCount &gt; 0 &amp;&amp; this.downloadFailCount &#061;&#061;&#061; this.downloadCount) {<br \/>\n        this.downloadFailCount &#061; 0;<br \/>\n      } else {<br \/>\n        this.pauseDownload();<br \/>\n      }<br \/>\n    }<br \/>\n  }<\/p>\n<p>  startDownload(): void {<br \/>\n    if (this.downloadTask &#061;&#061;&#061; undefined) {<br \/>\n      request.agent.create(context, this.downloadConfig).then((task: request.agent.Task) &#061;&gt; {<br \/>\n        task.on(&#039;completed&#039;, this.completedCallback);<br \/>\n        task.on(&#039;failed&#039;, this.failedCallback);<br \/>\n        task.on(&#039;pause&#039;, this.pauseCallback);<br \/>\n        task.on(&#039;resume&#039;, this.resumeCallback);<br \/>\n        task.on(&#039;progress&#039;, this.progressCallback);<br \/>\n        task.on(&#039;response&#039;, this.responseCallback);<\/p>\n<p>        task.start().then(() &#061;&gt; {<br \/>\n          this.downloadTask &#061; task;<br \/>\n        }).catch((err: Error) &#061;&gt; {<br \/>\n          hilog.error(0x0000, TAG, &#039;task start error:&#039;, err);<br \/>\n        })<br \/>\n      }).catch((err: Error) &#061;&gt; {<br \/>\n        hilog.error(0x0000, TAG, &#039;create error:&#039;, err);<br \/>\n      });<br \/>\n    } else {<br \/>\n      this.resumeDownload();<br \/>\n    }<br \/>\n  }<\/p>\n<p>  pauseOrResumeDownload(): void {<br \/>\n    if (this.downloadTask) {<br \/>\n      request.agent.show(this.downloadTask.tid, (err: Error, taskInfo: request.agent.TaskInfo) &#061;&gt; {<br \/>\n        if (err) {<br \/>\n          hilog.error(0x0000, TAG, &#039;agent show error:&#039;, err);<br \/>\n          return;<br \/>\n        }<br \/>\n        if (taskInfo.progress.state &#061;&#061;&#061; request.agent.State.PAUSED) {<br \/>\n          this.resumeDownload();<br \/>\n        } else {<br \/>\n          this.pauseDownload();<br \/>\n        }<br \/>\n      });<br \/>\n    }<br \/>\n  }<\/p>\n<p>  pauseDownload(): void {<br \/>\n    if (this.downloadTask) {<br \/>\n      request.agent.show(this.downloadTask.tid, (err: Error, taskInfo: request.agent.TaskInfo) &#061;&gt; {<br \/>\n        if (err) {<br \/>\n          hilog.error(0x0000, TAG, &#039;agent show error:&#039;, err);<br \/>\n          return;<br \/>\n        }<br \/>\n        if (this.downloadTask &amp;&amp; (taskInfo.progress.state &#061;&#061;&#061; request.agent.State.WAITING || taskInfo.progress.state<br \/>\n          &#061;&#061;&#061; request.agent.State.RUNNING || taskInfo.progress.state &#061;&#061;&#061; request.agent.State.RETRYING)) {<br \/>\n          this.downloadTask.pause().then(() &#061;&gt; {<br \/>\n          }).catch((err: Error) &#061;&gt; {<br \/>\n            hilog.error(0x0000, TAG, &#039;task pause error:&#039;, err);<br \/>\n          });<br \/>\n        }<br \/>\n      });<br \/>\n    }<br \/>\n  }<\/p>\n<p>  resumeDownload(): void {<br \/>\n    if (this.downloadTask) {<br \/>\n      request.agent.show(this.downloadTask.tid, (err: Error, taskInfo: request.agent.TaskInfo) &#061;&gt; {<br \/>\n        if (err) {<br \/>\n          hilog.error(0x0000, TAG, &#039;agent show error:&#039;, err);<br \/>\n          return;<br \/>\n        }<br \/>\n        if (this.downloadTask &amp;&amp; taskInfo.progress.state &#061;&#061;&#061; request.agent.State.PAUSED) {<br \/>\n          this.downloadTask.resume().then(() &#061;&gt; {<br \/>\n          }).catch((err: Error) &#061;&gt; {<br \/>\n            hilog.error(0x0000, TAG, &#039;task resume error:&#039;, err);<br \/>\n          });<br \/>\n        }<br \/>\n      });<br \/>\n    }<br \/>\n  }<\/p>\n<p>  build() {<br \/>\n    RelativeContainer() {<br \/>\n      Image($r(&#039;app.media.multiple_files_download_file&#039;))<br \/>\n        .height($r(&#034;app.integer.multiple_files_download_image_size&#034;))<br \/>\n        .width($r(&#034;app.integer.multiple_files_download_image_size&#034;))<br \/>\n        .id(&#039;fileImage&#039;)<br \/>\n        .alignRules({<br \/>\n          center: { anchor: &#039;__container__&#039;, align: VerticalAlign.Center }<br \/>\n        })<\/p>\n<p>      Text(this.fileName)<br \/>\n        .fontSize($r(&#034;app.integer.multiple_files_download_text_font_size&#034;))<br \/>\n        .padding({ left: $r(&#034;app.integer.multiple_files_download_padding&#034;) })<br \/>\n        .alignRules({<br \/>\n          left: { anchor: &#039;fileImage&#039;, align: HorizontalAlign.End },<br \/>\n          top: { anchor: &#039;fileImage&#039;, align: VerticalAlign.Top },<br \/>\n        })<br \/>\n        .fontWeight(FontWeight.Medium)<br \/>\n        .margin({ top: $r(&#039;app.integer.item_name_top_margin&#039;) })<br \/>\n        .id(&#039;fileName&#039;)<\/p>\n<p>      ProgressButton({<br \/>\n        paused: this.isPaused,<br \/>\n        progress: this.progress,<br \/>\n        progressButtonWidth: $r(&#039;app.integer.progress_btn_width&#039;),<br \/>\n        content: this.textState,<br \/>\n        enable: true,<br \/>\n        clickCallback: () &#061;&gt; {<br \/>\n          this.pauseOrResumeDownload();<br \/>\n        }<br \/>\n      })<br \/>\n        .visibility(this.isShow ? Visibility.Visible : Visibility.Hidden)<br \/>\n        .alignRules({<br \/>\n          right: { anchor: &#039;__container__&#039;, align: HorizontalAlign.End },<br \/>\n          center: { anchor: &#039;__container__&#039;, align: VerticalAlign.Center }<br \/>\n        })<\/p>\n<p>      Text(this.sCurrentDownloadSize &#043; &#034;\/&#034; &#043; this.sFileSize)<br \/>\n        .fontSize($r(&#039;app.integer.multiple_files_download_text_font_size_fourteen&#039;))<br \/>\n        .width($r(&#039;app.string.multiple_files_download_text_width&#039;))<br \/>\n        .fontColor($r(&#039;app.color.multiple_files_download_text_font_color&#039;))<br \/>\n        .margin({ top: $r(&#034;app.integer.multiple_files_download_margin_top&#034;) })<br \/>\n        .padding({ left: $r(&#034;app.integer.multiple_files_download_padding&#034;) })<br \/>\n        .alignRules({<br \/>\n          top: { anchor: &#039;fileName&#039;, align: VerticalAlign.Bottom },<br \/>\n          left: { anchor: &#039;fileImage&#039;, align: HorizontalAlign.End }<br \/>\n        })<br \/>\n        .id(&#039;downloadVal&#039;)<\/p>\n<p>    }<br \/>\n    .height($r(&#039;app.integer.item_height&#039;))<br \/>\n    .margin({ left: 16, right: 16 })<br \/>\n    .padding({ left: 12, right: 12 })<br \/>\n  }<br \/>\n} <\/p>\n<p>2.3\u00a0\u00a0ProgressButton.ets,\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7684\u7ec4\u5efa\u5b9e\u73b0\u4e86&#xff1a;\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u767e\u5206\u6bd4&#xff0c;\u6839\u636e\u72b6\u6001\u663e\u793a\u4e0d\u540c\u6587\u672c&#xff08;\u4e0b\u8f7d\u4e2d\/\u6682\u505c\/\u5b8c\u6210&#xff09;&#xff0c;\u63d0\u4f9b\u70b9\u51fb\u56de\u8c03\u529f\u80fd\u3002<\/p>\n<p>\u7b80\u5355\u8bf4\u660e&#xff1a;<\/p>\n<p>\u4f7f\u7528HarmonyOS\u7684Progress\u7ec4\u4ef6\u663e\u793a\u8fdb\u5ea6\u6761<\/p>\n<p>\u6839\u636e\u8fdb\u5ea6\u503c\u81ea\u52a8\u66f4\u65b0\u663e\u793a\u6587\u672c<\/p>\n<p>\u652f\u6301\u542f\u7528\/\u7981\u7528\u72b6\u6001<\/p>\n<p>\u63d0\u4f9b\u5706\u89d2\u80f6\u56ca\u6837\u5f0f<\/p>\n<\/p>\n<p>const EMPTY_STRING: string &#061; &#039;&#039;;<br \/>\nconst MAX_PROGRESS: number &#061; 100;<br \/>\nconst MAX_PERCENTAGE: string &#061; &#039;100%&#039;;<br \/>\nconst MIN_PERCENTAGE: string &#061; &#039;0%&#039;;<br \/>\nconst TEXT_OPACITY: number &#061; 0.4;<br \/>\nconst BUTTON_NORMAL_WIDTH: number &#061; 44;<br \/>\nconst BUTTON_NORMAL_HEIGHT: number &#061; 28;<br \/>\nconst BUTTON_BORDER_RADIUS: number &#061; 14;<br \/>\nconst TEXT_ENABLE: number &#061; 1.0;<br \/>\nconst MIN_WIDTH: Length &#061; 44;<br \/>\nconst PADDING_TEXT: Length &#061; 8;<\/p>\n<p>const PROGRESS_BUTTON_PROGRESS_KEY &#061; &#039;progress_button_progress_key&#039;;<br \/>\nconst PROGRESS_BUTTON_PRIMARY_FONT_KEY &#061; &#039;progress_button_primary_font_key&#039;;<br \/>\nconst PROGRESS_BUTTON_CONTAINER_BACKGROUND_COLOR_KEY &#061; &#039;progress_button_container_background_color_key&#039;;<br \/>\nconst PROGRESS_BUTTON_EMPHASIZE_SECONDARY_BUTTON_KEY &#061; &#039;progress_button_emphasize_secondary_button_key&#039;;<\/p>\n<p>&#064;Component<br \/>\nexport struct ProgressButton {<br \/>\n  &#064;Prop &#064;Watch(&#039;updateText&#039;) paused: boolean &#061; false;<br \/>\n  &#064;Prop &#064;Watch(&#039;getProgressContext&#039;) progress: number;<br \/>\n  &#064;State textProgress: string &#061; EMPTY_STRING;<br \/>\n  &#064;Prop content: string | Resource &#061; EMPTY_STRING;<br \/>\n  &#064;State isLoading: boolean &#061; false;<br \/>\n  progressButtonWidth?: Length &#061; BUTTON_NORMAL_WIDTH;<br \/>\n  clickCallback: () &#061;&gt; void &#061; () &#061;&gt; {<br \/>\n  };<br \/>\n  &#064;Prop enable: boolean &#061; true;<br \/>\n  &#064;State progressColor: ResourceColor &#061; &#039;#330A59F7&#039;;<br \/>\n  &#064;State containerBorderColor: ResourceColor &#061; &#039;#330A59F7&#039;;<br \/>\n  &#064;State containerBackgroundColor: ResourceColor &#061; $r(&#039;sys.color.ohos_id_color_foreground_contrary&#039;);<\/p>\n<p>  private getButtonProgress(): number {<br \/>\n    if (this.progress &lt; 0) {<br \/>\n      return 0;<br \/>\n    } else if (this.progress &gt; MAX_PROGRESS) {<br \/>\n      return MAX_PROGRESS;<br \/>\n    }<br \/>\n    return this.progress;<br \/>\n  }<\/p>\n<p>  updateText() {<br \/>\n    if (this.paused) {<br \/>\n      setTimeout(() &#061;&gt; {<br \/>\n        this.isLoading &#061; !this.paused;<br \/>\n      }, 10);<br \/>\n    } else {<br \/>\n      this.isLoading &#061; !this.paused;<br \/>\n    }<br \/>\n  }<\/p>\n<p>  private getProgressContext() {<br \/>\n    if (this.progress &lt; 0) {<br \/>\n      this.isLoading &#061; false;<br \/>\n      this.textProgress &#061; MIN_PERCENTAGE;<br \/>\n    } else if (this.progress &gt;&#061; MAX_PROGRESS) {<br \/>\n      this.isLoading &#061; false;<br \/>\n      this.textProgress &#061; MAX_PERCENTAGE;<br \/>\n    } else {<br \/>\n      this.isLoading &#061; true;<br \/>\n      this.textProgress &#061; Math.floor(this.progress \/ MAX_PROGRESS * MAX_PROGRESS).toString() &#043; &#034;%&#034;;<br \/>\n    }<br \/>\n  }<\/p>\n<p>  build() {<br \/>\n    Button() {<br \/>\n      Stack() {<br \/>\n        Progress({<br \/>\n          value: this.getButtonProgress(), total: MAX_PROGRESS,<br \/>\n          style: ProgressStyle.Capsule<br \/>\n        })<br \/>\n          .height(BUTTON_NORMAL_HEIGHT)<br \/>\n          .borderRadius(BUTTON_BORDER_RADIUS)<br \/>\n          .width(&#039;100%&#039;)<br \/>\n          .hoverEffect(HoverEffect.None)<br \/>\n          .clip(false)<br \/>\n          .enabled(this.enable)<br \/>\n          .key(PROGRESS_BUTTON_PROGRESS_KEY)<br \/>\n          .color(this.progressColor)<br \/>\n        Text(this.isLoading ? this.textProgress : this.content)<br \/>\n          .fontSize($r(&#039;sys.float.ohos_id_text_size_button3&#039;))<br \/>\n          .fontWeight(FontWeight.Medium)<br \/>\n          .key(PROGRESS_BUTTON_PRIMARY_FONT_KEY)<br \/>\n          .maxLines(1)<br \/>\n          .textOverflow({ overflow: TextOverflow.Ellipsis })<br \/>\n          .padding({ left: PADDING_TEXT, right: PADDING_TEXT })<br \/>\n          .opacity(this.enable ? TEXT_ENABLE : TEXT_OPACITY)<\/p>\n<p>        Row()<br \/>\n          .key(PROGRESS_BUTTON_CONTAINER_BACKGROUND_COLOR_KEY)<br \/>\n          .backgroundColor(Color.Transparent)<br \/>\n          .border({ width: 1, color: this.containerBorderColor })<br \/>\n          .height(BUTTON_NORMAL_HEIGHT)<br \/>\n          .borderRadius(BUTTON_BORDER_RADIUS)<br \/>\n          .width(&#039;100%&#039;)<br \/>\n      }<br \/>\n    }<br \/>\n    .borderRadius(BUTTON_BORDER_RADIUS)<br \/>\n    .clip(false)<br \/>\n    .hoverEffect(HoverEffect.None)<br \/>\n    .key(PROGRESS_BUTTON_EMPHASIZE_SECONDARY_BUTTON_KEY)<br \/>\n    .backgroundColor(this.containerBackgroundColor)<br \/>\n    .constraintSize({ minWidth: MIN_WIDTH })<br \/>\n    .width((!this.progressButtonWidth || this.progressButtonWidth &lt; BUTTON_NORMAL_WIDTH) ?<br \/>\n      BUTTON_NORMAL_WIDTH : this.progressButtonWidth)<br \/>\n    .stateEffect(this.enable)<br \/>\n    .onClick(() &#061;&gt; {<br \/>\n      if (!this.enable) {<br \/>\n        return;<br \/>\n      }<br \/>\n      if (this.progress &lt; MAX_PROGRESS) {<br \/>\n        this.isLoading &#061; !this.isLoading;<br \/>\n      }<br \/>\n      this.clickCallback &amp;&amp; this.clickCallback();<br \/>\n    })<br \/>\n  }<br \/>\n} <\/p>\n<p>2.4\u00a0 module.json5\u6743\u9650\u9700\u8981\u6dfb\u52a0ohos.permission.INTERNET<\/p>\n<p> {<br \/>\n  &#034;module&#034;: {<br \/>\n    &#034;name&#034;: &#034;entry&#034;,<br \/>\n    &#034;type&#034;: &#034;entry&#034;,<br \/>\n    &#034;description&#034;: &#034;$string:module_desc&#034;,<br \/>\n    &#034;mainElement&#034;: &#034;EntryAbility&#034;,<br \/>\n    &#034;deviceTypes&#034;: [<br \/>\n      &#034;phone&#034;<br \/>\n    ],<br \/>\n    &#034;requestPermissions&#034;: [<br \/>\n      {<br \/>\n        &#034;name&#034;: &#034;ohos.permission.INTERNET&#034;,<br \/>\n        &#034;reason&#034;: &#034;$string:reason_internet&#034;,<br \/>\n        &#034;usedScene&#034;: {<br \/>\n          &#034;abilities&#034;: [<br \/>\n            &#034;EntryAbility&#034;<br \/>\n          ],<br \/>\n          &#034;when&#034;: &#034;always&#034;<br \/>\n        }<br \/>\n      },<br \/>\n    ],<br \/>\n    &#034;deliveryWithInstall&#034;: true,<br \/>\n    &#034;installationFree&#034;: false,<br \/>\n    &#034;pages&#034;: &#034;$profile:main_pages&#034;,<br \/>\n    &#034;abilities&#034;: [<br \/>\n      {<br \/>\n        &#034;name&#034;: &#034;EntryAbility&#034;,<br \/>\n        &#034;srcEntry&#034;: &#034;.\/ets\/entryability\/EntryAbility.ets&#034;,<br \/>\n        &#034;description&#034;: &#034;$string:EntryAbility_desc&#034;,<br \/>\n        &#034;icon&#034;: &#034;$media:layered_image&#034;,<br \/>\n        &#034;label&#034;: &#034;$string:EntryAbility_label&#034;,<br \/>\n        &#034;startWindowIcon&#034;: &#034;$media:startIcon&#034;,<br \/>\n        &#034;startWindowBackground&#034;: &#034;$color:start_window_background&#034;,<br \/>\n        &#034;exported&#034;: true,<br \/>\n        &#034;skills&#034;: [<br \/>\n          {<br \/>\n            &#034;entities&#034;: [<br \/>\n              &#034;entity.system.home&#034;<br \/>\n            ],<br \/>\n            &#034;actions&#034;: [<br \/>\n              &#034;action.system.home&#034;<br \/>\n            ]<br \/>\n          }<br \/>\n        ]<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n} <\/p>\n<p>\u4e09\u3001\u6f14\u793a\u6548\u679c,\u4e0b\u8f7d\u5730\u5740\u6570\u7ec4\u91cc\u53ea\u7528\u5199\u4e861\u4e2a&#xff0c;\u6240\u4ee5\u53ea\u67091\u4e2a\u6587\u4ef6&#xff0c;\u9700\u8981\u7684\u53ef\u4ee5\u81ea\u884c\u6dfb\u52a0\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"785\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816032509-689ffa15f03af.png\" width=\"955\" \/><\/p>\n<\/p>\n<p>\u56db\u3001\u5de5\u7a0b\u4e0b\u8f7d\u7f51\u5740&#xff1a;https:\/\/download.csdn.net\/download\/ajassi2000\/91685765?spm&#061;1011.2124.3001.6210<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb372\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf5\u6b21\u3002\u672c\u6587\u8bb0\u5f55\u4e86\u4e00\u4e2a\u5d4c\u5165\u5f0f\u5f00\u53d1\u8005\u5b66\u4e60ArkTS\u5f00\u53d1HarmonyOS\u5e94\u7528\u7684\u8fc7\u7a0b\uff0c\u91cd\u70b9\u5c55\u793a\u4e86\u4e00\u4e2a\u591a\u6587\u4ef6\u4e0b\u8f7d\u5e94\u7528\u7684\u5b9e\u73b0\u3002\u5e94\u7528\u5305\u542b\u4e09\u4e2a\u4e3b\u8981\u7ec4\u4ef6\uff1aMultipleFilesDownload\u4e3b\u7ba1\u7406\u7ec4\u4ef6\u3001FileDownloadItem\u4e0b\u8f7d\u9879\u7ec4\u4ef6\u548cProgressButton\u8fdb\u5ea6\u6309\u94ae\u7ec4\u4ef6\u3002\u6587\u7ae0\u8be6\u7ec6\u89e3\u6790\u4e86\u5de5\u7a0b\u7ed3\u6784\u3001\u5404\u7ec4\u4ef6\u529f\u80fd\u5b9e\u73b0\u548c\u4ea4\u4e92\u903b\u8f91\uff0c\u5305\u62ec\u4e0b\u8f7d\u4efb\u52a1\u7ba1\u7406\u3001\u8fdb\u5ea6\u663e\u793a\u3001\u6682\u505c\/\u6062\u590d\u529f\u80fd\u7b49\u3002\u540c\u65f6\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u4ee3\u7801\u793a\u4f8b\u548c\u6f14\u793a\u6548\u679c\uff0c\u5e76\u9644\u5e26\u4e86\u76f8\u5173\u6743\u9650\u914d\u7f6e\u8bf4\u660e\u548c\u5f00\u6e90\u5de5\u7a0b\u4e0b\u8f7d\u94fe\u63a5\u3002\u8be5\u6848\u4f8b\u53ef\u4f5c\u4e3aHarmonyOS\u5e94\u7528\u5f00\u53d1\u7684\u53c2\u8003\u6a21\u677f\u3002<\/p>\n","protected":false},"author":2,"featured_media":58478,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[280,4121,67,227],"topic":[],"class_list":["post-58480","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-harmonyos","tag-linux-c---app","tag-67","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \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\/58480.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb372\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf5\u6b21\u3002\u672c\u6587\u8bb0\u5f55\u4e86\u4e00\u4e2a\u5d4c\u5165\u5f0f\u5f00\u53d1\u8005\u5b66\u4e60ArkTS\u5f00\u53d1HarmonyOS\u5e94\u7528\u7684\u8fc7\u7a0b\uff0c\u91cd\u70b9\u5c55\u793a\u4e86\u4e00\u4e2a\u591a\u6587\u4ef6\u4e0b\u8f7d\u5e94\u7528\u7684\u5b9e\u73b0\u3002\u5e94\u7528\u5305\u542b\u4e09\u4e2a\u4e3b\u8981\u7ec4\u4ef6\uff1aMultipleFilesDownload\u4e3b\u7ba1\u7406\u7ec4\u4ef6\u3001FileDownloadItem\u4e0b\u8f7d\u9879\u7ec4\u4ef6\u548cProgressButton\u8fdb\u5ea6\u6309\u94ae\u7ec4\u4ef6\u3002\u6587\u7ae0\u8be6\u7ec6\u89e3\u6790\u4e86\u5de5\u7a0b\u7ed3\u6784\u3001\u5404\u7ec4\u4ef6\u529f\u80fd\u5b9e\u73b0\u548c\u4ea4\u4e92\u903b\u8f91\uff0c\u5305\u62ec\u4e0b\u8f7d\u4efb\u52a1\u7ba1\u7406\u3001\u8fdb\u5ea6\u663e\u793a\u3001\u6682\u505c\/\u6062\u590d\u529f\u80fd\u7b49\u3002\u540c\u65f6\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u4ee3\u7801\u793a\u4f8b\u548c\u6f14\u793a\u6548\u679c\uff0c\u5e76\u9644\u5e26\u4e86\u76f8\u5173\u6743\u9650\u914d\u7f6e\u8bf4\u660e\u548c\u5f00\u6e90\u5de5\u7a0b\u4e0b\u8f7d\u94fe\u63a5\u3002\u8be5\u6848\u4f8b\u53ef\u4f5c\u4e3aHarmonyOS\u5e94\u7528\u5f00\u53d1\u7684\u53c2\u8003\u6a21\u677f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58480.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-16T03:25:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816032507-689ffa1362c6d.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=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58480.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58480.html\",\"name\":\"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-16T03:25:12+00:00\",\"dateModified\":\"2025-08-16T03:25:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58480.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58480.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58480.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf--http\u591a\u6587\u4ef6\u4e0b\u8f7d\"}]},{\"@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":"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \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\/58480.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb372\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf5\u6b21\u3002\u672c\u6587\u8bb0\u5f55\u4e86\u4e00\u4e2a\u5d4c\u5165\u5f0f\u5f00\u53d1\u8005\u5b66\u4e60ArkTS\u5f00\u53d1HarmonyOS\u5e94\u7528\u7684\u8fc7\u7a0b\uff0c\u91cd\u70b9\u5c55\u793a\u4e86\u4e00\u4e2a\u591a\u6587\u4ef6\u4e0b\u8f7d\u5e94\u7528\u7684\u5b9e\u73b0\u3002\u5e94\u7528\u5305\u542b\u4e09\u4e2a\u4e3b\u8981\u7ec4\u4ef6\uff1aMultipleFilesDownload\u4e3b\u7ba1\u7406\u7ec4\u4ef6\u3001FileDownloadItem\u4e0b\u8f7d\u9879\u7ec4\u4ef6\u548cProgressButton\u8fdb\u5ea6\u6309\u94ae\u7ec4\u4ef6\u3002\u6587\u7ae0\u8be6\u7ec6\u89e3\u6790\u4e86\u5de5\u7a0b\u7ed3\u6784\u3001\u5404\u7ec4\u4ef6\u529f\u80fd\u5b9e\u73b0\u548c\u4ea4\u4e92\u903b\u8f91\uff0c\u5305\u62ec\u4e0b\u8f7d\u4efb\u52a1\u7ba1\u7406\u3001\u8fdb\u5ea6\u663e\u793a\u3001\u6682\u505c\/\u6062\u590d\u529f\u80fd\u7b49\u3002\u540c\u65f6\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u4ee3\u7801\u793a\u4f8b\u548c\u6f14\u793a\u6548\u679c\uff0c\u5e76\u9644\u5e26\u4e86\u76f8\u5173\u6743\u9650\u914d\u7f6e\u8bf4\u660e\u548c\u5f00\u6e90\u5de5\u7a0b\u4e0b\u8f7d\u94fe\u63a5\u3002\u8be5\u6848\u4f8b\u53ef\u4f5c\u4e3aHarmonyOS\u5e94\u7528\u5f00\u53d1\u7684\u53c2\u8003\u6a21\u677f\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/58480.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-16T03:25:12+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250816032507-689ffa1362c6d.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58480.html","url":"https:\/\/www.wsisp.com\/helps\/58480.html","name":"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf-http\u591a\u6587\u4ef6\u4e0b\u8f7d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-16T03:25:12+00:00","dateModified":"2025-08-16T03:25:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58480.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58480.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58480.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5f00\u6e90 Arkts \u9e3f\u8499\u5e94\u7528 \u5f00\u53d1\uff08\u5341\u4e03\uff09\u901a\u8baf--http\u591a\u6587\u4ef6\u4e0b\u8f7d"}]},{"@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\/58480","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=58480"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58480\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/58478"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58480"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}