{"id":194,"date":"2026-05-09T19:58:14","date_gmt":"2026-05-09T11:58:14","guid":{"rendered":"https:\/\/www.gaohui.xyz\/?p=194"},"modified":"2026-05-09T19:59:44","modified_gmt":"2026-05-09T11:59:44","slug":"%e7%94%a8-c-%e5%92%8c-cloud-files-api-%e6%89%93%e9%80%a0%e4%b8%80%e4%b8%aa%e7%b1%bb-onedrive-%e7%9a%84%e7%bd%91%e7%9b%98%e5%ae%a2%e6%88%b7%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.gaohui.xyz\/?p=194","title":{"rendered":"\u7528 C# \u548c Cloud Files API \u6253\u9020\u4e00\u4e2a\u7c7b OneDrive \u7684\u7f51\u76d8\u5ba2\u6237\u7aef"},"content":{"rendered":"<h1><\/h1>\n<blockquote><p>\u4e00\u4e2a\u57fa\u4e8e\u817e\u8baf\u4e91 SMH \u7684 Windows \u7f51\u76d8\u5ba2\u6237\u7aef Demo\uff0c\u4ece\u96f6\u5230\u5b8c\u5168\u53ef\u7528\u7684\u5168\u8fc7\u7a0b\u8bb0\u5f55\u3002<\/p><\/blockquote>\n<h2>\u524d\u8a00<\/h2>\n<p>\u4f60\u6709\u6ca1\u6709\u60f3\u8fc7\uff0c<strong>OneDrive \u90a3\u79cd&#8221;\u70b9\u51fb\u5373\u4e0b\u8f7d\u3001\u4e91\u7aef\u56fe\u6807\u72b6\u6001&#8221;\u7684\u4f53\u9a8c\u662f\u600e\u4e48\u5b9e\u73b0\u7684\uff1f<\/strong><\/p>\n<p>Windows \u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\uff0cOneDrive \u6587\u4ef6\u5de6\u4e0b\u89d2\u4f1a\u663e\u793a\u4e00\u4e2a\u84dd\u8272\u5c0f\u4e91\u6735\uff08\u2601\ufe0f\uff09\uff0c\u53cc\u51fb\u540e\u81ea\u52a8\u4e0b\u8f7d\u5e76\u6253\u5f00\uff0c\u4e0b\u8f7d\u5b8c\u6210\u540e\u53d8\u6210\u7eff\u8272\u5bf9\u52fe\uff08\u2705\uff09\u3002\u53f3\u952e\u8fd8\u80fd\u9009\u62e9&#8221;\u91ca\u653e\u7a7a\u95f4&#8221;\u628a\u672c\u5730\u6587\u4ef6\u53d8\u56de\u4e91\u6735\u3002\u8fd9\u5957\u4f53\u9a8c\u770b\u8d77\u6765\u5f88\u795e\u5947\uff0c\u4f46\u6838\u5fc3\u5176\u5b9e\u662f\u4e00\u4e2a\u53eb\u505a <strong>Cloud Files API (cfapi)<\/strong> \u7684 Windows \u7cfb\u7edf\u7ea7 API\u3002<\/p>\n<p>\u672c\u6587\u5206\u4eab\u4e86\u6211\u7528 C# \u57fa\u4e8e Cloud Files API \u548c\u817e\u8baf\u4e91\u667a\u80fd\u5a92\u8d44\u6258\u7ba1\uff08SMH\uff09\u4ece\u96f6\u642d\u5efa\u4e00\u4e2a\u7f51\u76d8\u5ba2\u6237\u7aef\u7684\u5b8c\u6574\u8fc7\u7a0b\uff0c\u5305\u62ec\u8e29\u8fc7\u7684\u5751\u548c\u6700\u7ec8\u65b9\u6848\u3002<\/p>\n<h2>\u9879\u76ee\u662f\u4ec0\u4e48<\/h2>\n<p><strong>SmhDemo<\/strong> \u662f\u4e00\u4e2a Windows \u7f51\u76d8\u5ba2\u6237\u7aef Demo\uff0c\u5b9e\u73b0\u4e86\u4ee5\u4e0b\u6838\u5fc3\u529f\u80fd\uff1a<\/p>\n<ul>\n<li>\u5728 Windows \u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u6ce8\u518c\u4e00\u4e2a\u865a\u62df&#8221;SMH \u7f51\u76d8&#8221;\u540c\u6b65\u76d8<\/li>\n<li>\u6d4f\u89c8\u4e91\u7aef\u6587\u4ef6\u76ee\u5f55\uff0c\u6587\u4ef6\u663e\u793a\u4e3a&#8221;\u4ec5\u8054\u673a&#8221;\uff08\u2601\ufe0f \u4e91\u6735\u56fe\u6807\uff09<\/li>\n<li>\u53cc\u51fb\u6587\u4ef6\u81ea\u52a8\u4e0b\u8f7d\u5e76\u6253\u5f00\uff0c\u5b8c\u6210\u540e\u53d8\u4e3a&#8221;\u5df2\u5728\u6b64\u8bbe\u5907\u4e0a&#8221;\uff08\u2705 \u7eff\u8272\u52fe\uff09<\/li>\n<li>\u652f\u6301&#8221;\u91ca\u653e\u7a7a\u95f4&#8221;\u8131\u6c34\u3001&#8221;\u59cb\u7ec8\u4fdd\u7559&#8221;\u56fa\u5b9a\u7b49 OneDrive \u540c\u6b3e\u64cd\u4f5c<\/li>\n<li>\u62d6\u62fd\/\u590d\u5236\u6587\u4ef6\u5230\u7f51\u76d8\u81ea\u52a8\u4e0a\u4f20\uff0c\u652f\u6301\u79d2\u4f20\u68c0\u6d4b<\/li>\n<li>\u6587\u4ef6\u5939\u521b\u5efa\u3001\u5220\u9664\u3001\u91cd\u547d\u540d\u7b49\u5b8c\u6574\u6587\u4ef6\u7ba1\u7406<\/li>\n<li>\u53cc\u5411\u589e\u91cf\u540c\u6b65\uff08\u4e91\u7aef\u53d8\u66f4\u81ea\u52a8\u540c\u6b65\u5230\u672c\u5730\uff09<\/li>\n<li>\u51b2\u7a81\u68c0\u6d4b\u4e0e\u89e3\u51b3<\/li>\n<\/ul>\n<pre><code>\ud83d\udcc1 \u6b64\u7535\u8111\n\u251c\u2500\u2500 \u2601\ufe0f SMH \u7f51\u76d8                    \u2190 \u6ce8\u518c\u7684\u540c\u6b65\u6839\n\u2502   \u251c\u2500\u2500 \ud83d\udcc1 \u5de5\u4f5c\u6587\u6863\/\n\u2502   \u2502   \u251c\u2500\u2500 \u2601\ufe0f  \u62a5\u544a.docx          [\u5360\u4f4d\u7b26 - \u4e91\u7aef]\n\u2502   \u2502   \u251c\u2500\u2500 \u2705  \u65b9\u6848.pdf           [\u5df2\u4e0b\u8f7d - \u672c\u5730]\n\u2502   \u2502   \u2514\u2500\u2500 \ud83d\udccc  \u5408\u540c.pdf           [\u5df2\u56fa\u5b9a - \u4e0d\u81ea\u52a8\u56de\u6536]\n\u2502   \u251c\u2500\u2500 \ud83d\udcc1 \u56fe\u7247\/\n\u2502   \u2514\u2500\u2500 \u2705  \u8bf4\u660e.txt<\/code><\/pre>\n<h2>\u4e3a\u4ec0\u4e48\u9009 SMH \u4f5c\u4e3a\u540e\u7aef<\/h2>\n<p>\u8fd9\u4e2a\u9879\u76ee\u7684\u6838\u5fc3\u76ee\u6807\u662f\u505a\u4e00\u4e2a<strong>\u7c7b OneDrive \u7684\u7f51\u76d8\u5ba2\u6237\u7aef<\/strong>\uff0c\u800c\u817e\u8baf\u4e91\u667a\u80fd\u5a92\u8d44\u6258\u7ba1\uff08Smart Media Hosting\uff0cSMH\uff09\u6b63\u662f\u4e3a\u8fd9\u7c7b\u573a\u666f\u91cf\u8eab\u6253\u9020\u7684 PaaS \u4ea7\u54c1\u3002<\/p>\n<h3>SMH \u662f\u4ec0\u4e48<\/h3>\n<p>SMH \u5b9a\u4f4d\u4e8e\u5bf9\u8c61\u5b58\u50a8 COS \u4e4b\u4e0a\u7684<strong>\u5b58\u50a8\u5904\u7406\u4e2d\u95f4\u4ef6<\/strong>\uff0c\u4e13\u95e8\u4e3a\u5f00\u53d1\u8005\u6784\u5efa\u7f51\u76d8\u3001\u76f8\u518c\u3001\u5c0f\u7a0b\u5e8f\u7b49\u5a92\u8d44\u5e94\u7528\u63d0\u4f9b\u4e00\u7ad9\u5f0f\u89e3\u51b3\u65b9\u6848\u3002\u76f8\u6bd4\u76f4\u63a5\u4f7f\u7528 COS\uff0cSMH \u5728\u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u505a\u4e86\u5173\u952e\u589e\u5f3a\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u80fd\u529b\u7ef4\u5ea6<\/th>\n<th>COS\uff08\u5bf9\u8c61\u5b58\u50a8\uff09<\/th>\n<th>SMH\uff08\u667a\u80fd\u5a92\u8d44\u6258\u7ba1\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u8d26\u53f7\u4f53\u7cfb<\/strong><\/td>\n<td>\u9700\u81ea\u884c\u5b9e\u73b0<\/td>\n<td>\u5185\u7f6e ToC \u8d26\u53f7\u7ba1\u7406\u3001\u591a\u79df\u6237\u9694\u79bb<\/td>\n<\/tr>\n<tr>\n<td><strong>\u6587\u4ef6\u7ba1\u7406<\/strong><\/td>\n<td>\u6241\u5e73 Key-Value<\/td>\n<td>\u9ad8\u6548\u76ee\u5f55\u5f0f\u6587\u4ef6\u7ba1\u7406\u3001ETag \u53d8\u66f4\u8ffd\u8e2a<\/td>\n<\/tr>\n<tr>\n<td><strong>\u667a\u80fd\u5904\u7406<\/strong><\/td>\n<td>\u9700\u989d\u5916\u63a5\u5165\u6570\u636e\u4e07\u8c61<\/td>\n<td>\u5185\u7f6e AI \u5206\u6790\uff08\u4eba\u8138\u3001\u6807\u7b7e\u3001\u5143\u6570\u636e\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>SMH \u7684\u6838\u5fc3\u80fd\u529b<\/h3>\n<p><strong>\u5b58\u50a8\u4e0e\u7ba1\u7406<\/strong>\uff1a\u6587\u4ef6\u6570\u636e\u6258\u7ba1\u5728\u817e\u8baf\u4e91 COS \u4e0a\uff0c\u4eab\u53d7\u591a\u67b6\u6784\u5197\u4f59\u3001\u5f02\u5730\u5bb9\u707e\u3001\u9ad8\u6301\u4e45\u6027\u4fdd\u969c\u3002SMH \u5728\u6b64\u57fa\u7840\u4e0a\u63d0\u4f9b\u4e86\u76ee\u5f55\u5f0f\u6587\u4ef6\u7ba1\u7406\u3001\u6587\u4ef6\u7ea7\u522b\u8bfb\u5199\u6743\u9650\u63a7\u5236\u3001\u72ec\u7acb\u8bbf\u95ee\u4ee4\u724c\u9274\u6743\uff0c\u4ee5\u53ca\u5a92\u4f53\u5e93\u548c\u79df\u6237\u7a7a\u95f4\u7684\u4ea4\u53c9\u6388\u6743\u4f53\u7cfb\u3002<\/p>\n<p><strong>\u6587\u4ef6\u64cd\u4f5c API<\/strong>\uff1a\u63d0\u4f9b\u5b8c\u6574\u7684 RESTful API\uff0c\u672c\u9879\u76ee\u7528\u5230\u7684\u5173\u952e\u63a5\u53e3\u5305\u62ec\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>API \u80fd\u529b<\/th>\n<th>\u8bf4\u660e<\/th>\n<th>\u672c\u9879\u76ee\u4f7f\u7528\u65b9\u5f0f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u76ee\u5f55\u5217\u8868<\/td>\n<td>\u9012\u5f52\u904d\u5386\u4e91\u7aef\u76ee\u5f55\u6811<\/td>\n<td>\u7528\u6237\u6d4f\u89c8\u7f51\u76d8\u6587\u4ef6\u5939\u65f6\u8c03\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u4e0b\u8f7d<\/td>\n<td>302 \u8df3\u8f6c\u5230 COS URL\uff0c\u652f\u6301 Range \u65ad\u70b9\u7eed\u4f20<\/td>\n<td>\u6c34\u5408\u5f15\u64ce\u4e09\u9636\u6bb5\u4e0b\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u7b80\u5355\u4e0a\u4f20<\/td>\n<td>\u2264100MB \u6587\u4ef6\u4e00\u6b65\u4e0a\u4f20<\/td>\n<td>\u5c0f\u6587\u4ef6\u76f4\u63a5\u4e0a\u4f20<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u7247\u4e0a\u4f20<\/td>\n<td>&gt;100MB \u5927\u6587\u4ef6\u5206\u7247\u4f20\u8f93<\/td>\n<td>\u5927\u6587\u4ef6\u4e0a\u4f20<\/td>\n<\/tr>\n<tr>\n<td>\u79d2\u4f20\u68c0\u6d4b<\/td>\n<td>\u901a\u8fc7 SHA-256 Hash \u5339\u914d\u5df2\u6709\u6587\u4ef6\uff0c\u547d\u4e2d\u5373\u8df3\u8fc7\u4e0a\u4f20<\/td>\n<td>\u62d6\u62fd\u6587\u4ef6\u65f6\u81ea\u52a8\u63a2\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u5143\u6570\u636e\u64cd\u4f5c<\/td>\n<td>\u521b\u5efa\u76ee\u5f55\u3001\u5220\u9664\u3001\u91cd\u547d\u540d<\/td>\n<td>\u5b8c\u6574\u7684\u6587\u4ef6\u7ba1\u7406\u529f\u80fd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u667a\u80fd\u5206\u6790\uff08AI \u80fd\u529b\uff09<\/strong>\uff1aSMH \u96c6\u6210\u4e86\u817e\u8baf\u4e91\u7684 AI \u6280\u672f\uff0c\u867d\u7136\u672c\u9879\u76ee\u662f Demo \u672a\u6df1\u5165\u4f7f\u7528\uff0c\u4f46\u8fd9\u662f SMH \u533a\u522b\u4e8e\u7eaf\u5b58\u50a8\u65b9\u6848\u7684\u6838\u5fc3\u4ef7\u503c\uff1a<\/p>\n<ul>\n<li><strong>\u4eba\u8138\u8bc6\u522b\u4e0e\u805a\u7c7b<\/strong> \u2014 \u81ea\u52a8\u8bc6\u522b\u56fe\u7247\u4e2d\u7684\u4eba\u8138\u5e76\u805a\u7c7b\uff0c\u9002\u5408\u667a\u80fd\u76f8\u518c\u573a\u666f<\/li>\n<li><strong>\u6807\u7b7e\u8bc6\u522b<\/strong> \u2014 \u5bf9\u56fe\u7247\u5185\u5bb9\u81ea\u52a8\u6253\u6807\u7b7e\uff0c\u6d77\u91cf\u6807\u7b7e\u8986\u76d6\u5e38\u89c1\u4e8b\u7269<\/li>\n<li><strong>\u5143\u6570\u636e\u63d0\u53d6<\/strong> \u2014 \u63d0\u53d6\u56fe\u7247\/\u89c6\u9891\u7684\u62cd\u6444\u65f6\u95f4\u3001GPS \u5b9a\u4f4d\u7b49\u4fe1\u606f<\/li>\n<li><strong>\u667a\u80fd\u68c0\u7d22<\/strong> \u2014 \u57fa\u4e8e\u6807\u7b7e\u3001\u4eba\u8138\u7b49 AI \u5206\u6790\u7ed3\u679c\u5b9e\u73b0\u5feb\u901f\u68c0\u7d22<\/li>\n<\/ul>\n<h3>\u4e3a\u4ec0\u4e48 SMH \u9002\u5408\u505a\u7f51\u76d8\u540e\u7aef<\/h3>\n<p>SMH \u5929\u7136\u652f\u6301\u7f51\u76d8\u573a\u666f\u6240\u9700\u7684\u6838\u5fc3\u80fd\u529b\uff1a\u79d2\u4f20\uff08\u907f\u514d\u91cd\u590d\u4f20\u8f93\uff09\u3001\u5206\u7247\u4e0a\u4f20\uff08\u5927\u6587\u4ef6\u53ef\u9760\u4f20\u8f93\uff09\u3001ETag \u53d8\u66f4\u8ffd\u8e2a\uff08\u589e\u91cf\u540c\u6b65\u7684\u57fa\u7840\uff09\u3001\u76ee\u5f55\u5f0f\u7ba1\u7406\uff08\u8d44\u6e90\u7ba1\u7406\u5668\u7684\u6587\u4ef6\u6811\u6620\u5c04\uff09\u3002\u540c\u65f6\uff0c\u5b83\u4f5c\u4e3a PaaS \u4e2d\u95f4\u4ef6\uff0c\u65e0\u9700\u81ea\u884c\u642d\u5efa\u5b58\u50a8\u670d\u52a1\u3001\u65e0\u9700\u7ba1\u7406\u670d\u52a1\u5668\uff0c\u7533\u8bf7\u4e00\u4e2a\u5a92\u4f53\u5e93\u5373\u53ef\u901a\u8fc7 API \u5b8c\u6210\u6240\u6709\u64cd\u4f5c\u3002<\/p>\n<p>\u672c\u9879\u76ee Demo \u9636\u6bb5\u4e3b\u8981\u4f7f\u7528\u4e86 SMH \u7684\u5b58\u50a8\u4e0e\u6587\u4ef6\u7ba1\u7406\u80fd\u529b\uff0c\u540e\u7eed\u5b8c\u5168\u53ef\u4ee5\u57fa\u4e8e SMH \u7684 AI \u80fd\u529b\u6269\u5c55\u51fa\u667a\u80fd\u76f8\u518c\u3001\u5185\u5bb9\u68c0\u7d22\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n<h2>\u6280\u672f\u9009\u578b<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u51b3\u7b56\u9879<\/th>\n<th>\u9009\u62e9<\/th>\n<th>\u7406\u7531<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5ba2\u6237\u7aef\u8bed\u8a00<\/td>\n<td>C# \/ .NET 8<\/td>\n<td>Windows API \u96c6\u6210\u65b9\u4fbf\uff0cP\/Invoke \u7075\u6d3b<\/td>\n<\/tr>\n<tr>\n<td>\u540e\u7aef\u5b58\u50a8<\/td>\n<td>\u817e\u8baf\u4e91 SMH<\/td>\n<td>\u514d\u642d\u5efa\uff0cAPI \u9f50\u5168\uff0c\u79d2\u4f20+\u5206\u7247+\u76ee\u5f55\u7ba1\u7406\u5f00\u7bb1\u5373\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u8d44\u6e90\u7ba1\u7406\u5668\u96c6\u6210<\/td>\n<td>Windows Cloud Files API (cfapi)<\/td>\n<td><strong>OneDrive \u540c\u6b3e\u6280\u672f<\/strong>\uff0c\u539f\u751f\u5360\u4f4d\u7b26\u6587\u4ef6+\u6309\u9700\u4e0b\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u672c\u5730\u72b6\u6001\u5b58\u50a8<\/td>\n<td>SQLite (WAL \u6a21\u5f0f)<\/td>\n<td>\u8f7b\u91cf\u53ef\u9760\uff0c\u7ebf\u7a0b\u5b89\u5168<\/td>\n<\/tr>\n<tr>\n<td>\u7cfb\u7edf\u6258\u76d8<\/td>\n<td>WinForms NotifyIcon<\/td>\n<td>\u540e\u53f0\u5e38\u9a7b\uff0c\u53f3\u952e\u83dc\u5355\u7ba1\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4e3a\u4ec0\u4e48\u9009 Cloud Files API \u800c\u4e0d\u662f\u5176\u4ed6\u65b9\u6848\uff1f<\/strong><\/p>\n<p>Windows \u63d0\u4f9b\u4e86\u51e0\u79cd\u4e0e\u8d44\u6e90\u7ba1\u7406\u5668\u96c6\u6210\u7684\u65b9\u5f0f\uff1a<\/p>\n<ul>\n<li><strong>Shell Namespace Extension (NSE)<\/strong>\uff1a\u9ad8\u5ea6\u81ea\u5b9a\u4e49\u4f46\u5f00\u53d1\u590d\u6742\u5ea6\u6781\u9ad8<\/li>\n<li><strong>Sync Engine (cfapi)<\/strong>\uff1aOneDrive\/OneDrive for Business \u4f7f\u7528\u7684\u65b9\u6848\uff0c\u539f\u751f\u652f\u6301\u5360\u4f4d\u7b26\u3001\u6309\u9700\u4e0b\u8f7d\u3001\u72b6\u6001\u56fe\u6807<\/li>\n<li><strong>\u865a\u62df\u6587\u4ef6\u7cfb\u7edf\u9a71\u52a8<\/strong>\uff1a\u9700\u8981\u5185\u6838\u7b7e\u540d\uff0c\u90e8\u7f72\u56f0\u96be<\/li>\n<\/ul>\n<p>cfapi \u662f\u552f\u4e00\u4e00\u4e2a&#8221;\u7cfb\u7edf\u5185\u7f6e + \u5f00\u53d1\u53cb\u597d + \u4f53\u9a8c\u548c OneDrive \u4e00\u81f4&#8221;\u7684\u65b9\u6848\u3002\u5b83\u662f Windows 10 1709 \u8d77\u5185\u7f6e\u7684 API\uff0c\u5fae\u8f6f\u5b98\u65b9\u79f0\u4e4b\u4e3a&#8221;Cloud Filter&#8221;\u3002<\/p>\n<h2>\u6574\u4f53\u67b6\u6784<\/h2>\n<p>\u6574\u4e2a\u7cfb\u7edf\u5206\u4e3a 6 \u5c42\uff0c\u4ece\u4e0a\u5230\u4e0b\u4f9d\u6b21\u4e3a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-195\" src=\"http:\/\/www.gaohui.xyz\/wp-content\/uploads\/2026\/05\/smh-demo-architecture.jpg\" alt=\"\" width=\"2040\" height=\"2538\" srcset=\"https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2026\/05\/smh-demo-architecture.jpg 2040w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2026\/05\/smh-demo-architecture-1235x1536.jpg 1235w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2026\/05\/smh-demo-architecture-1646x2048.jpg 1646w\" sizes=\"auto, (max-width: 2040px) 100vw, 2040px\" \/><\/p>\n<p><strong>\u5404\u5c42\u804c\u8d23<\/strong>\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c42<\/th>\n<th>\u9879\u76ee<\/th>\n<th>\u804c\u8d23<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Windows OS<\/strong><\/td>\n<td>\u7cfb\u7edf\u5c42<\/td>\n<td>Explorer \u63d0\u4f9b\u7528\u6237\u754c\u9762\uff0ccfapi \u63d0\u4f9b\u5360\u4f4d\u7b26\/\u56de\u8c03\u673a\u5236\uff0cNTFS \u63d0\u4f9b\u6587\u4ef6\u7cfb\u7edf\u652f\u6491<\/td>\n<\/tr>\n<tr>\n<td><strong>SmhDemo.App<\/strong><\/td>\n<td>\u5e94\u7528\u5c42<\/td>\n<td>SyncHostedService \u7ba1\u7406 6 \u6b65\u542f\u52a8\u5e8f\u5217\u548c\u751f\u547d\u5468\u671f\uff0c\u7cfb\u7edf\u6258\u76d8\u63d0\u4f9b\u72b6\u6001\u5c55\u793a\u548c\u64cd\u4f5c\u5165\u53e3<\/td>\n<\/tr>\n<tr>\n<td><strong>SmhDemo.CloudFiles<\/strong><\/td>\n<td>\u6838\u5fc3\u5c42<\/td>\n<td>SyncProvider \u5206\u53d1 cfapi \u56de\u8c03\uff0cHydrationEngine \u5904\u7406\u4e0b\u8f7d\u6c34\u5408\uff0cFSW \u76d1\u63a7\u672c\u5730\u53d8\u66f4\uff0cRemoteSyncService \u8f6e\u8be2\u4e91\u7aef\u53d8\u66f4<\/td>\n<\/tr>\n<tr>\n<td><strong>SmhDemo.SmhClient<\/strong><\/td>\n<td>HTTP \u5c42<\/td>\n<td>SmhHttpClient \u5c01\u88c5 SMH REST API\uff08\u79d2\u4f20\/\u7b80\u5355\/\u5206\u7247\u4e09\u79cd\u4e0a\u4f20\u6a21\u5f0f\uff09\uff0cTokenManager \u7ba1\u7406\u8bbf\u95ee\u4ee4\u724c<\/td>\n<\/tr>\n<tr>\n<td><strong>SmhDemo.Storage<\/strong><\/td>\n<td>\u6301\u4e45\u5c42<\/td>\n<td>SyncStateStore \u8bb0\u5f55\u6587\u4ef6\u540c\u6b65\u72b6\u6001\uff08\u8def\u5f84\/ETag\/\u5927\u5c0f\/InodeId\uff09\uff0cScopeRuleStore \u7ba1\u7406\u9009\u62e9\u6027\u540c\u6b65\u89c4\u5219<\/td>\n<\/tr>\n<tr>\n<td><strong>Cloud Backend<\/strong><\/td>\n<td>\u4e91\u7aef<\/td>\n<td>SMH API \u5904\u7406\u5143\u6570\u636e\u64cd\u4f5c\uff0cCOS \u5bf9\u8c61\u5b58\u50a8\u627f\u8f7d\u5b9e\u9645\u6587\u4ef6\u6570\u636e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u6570\u636e\u6d41<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>\u4e0b\u8f7d\u8def\u5f84<\/strong>\uff08\u84dd\u8272\uff09\uff1a\u7528\u6237\u53cc\u51fb\u6587\u4ef6 \u2192 Explorer \u89e6\u53d1 cfapi \u56de\u8c03 \u2192 HydrationEngine \u4e09\u9636\u6bb5\u6d41\u6c34\u7ebf\u4e0b\u8f7d \u2192 4MB \u5206\u5757\u4f20\u8f93\u7ed9 cfapi \u2192 \u6807\u8bb0 IN_SYNC<\/li>\n<li><strong>\u4e0a\u4f20\u8def\u5f84<\/strong>\uff08\u7eff\u8272\uff09\uff1aFSW \u68c0\u6d4b\u672c\u5730\u53d8\u66f4 \u2192 \u8ba1\u7b97 SHA-256 hash \u2192 \u8f6c\u6362\u4e3a\u540c\u6b65\u5360\u4f4d\u7b26 \u2192 \u79d2\u4f20\u63a2\u6d4b\/\u7b80\u5355\u4e0a\u4f20\/\u5206\u7247\u4e0a\u4f20<\/li>\n<li><strong>\u8fdc\u7a0b\u540c\u6b65<\/strong>\uff08\u6a59\u8272\uff09\uff1aRemoteSyncService \u6bcf 30 \u79d2\u8f6e\u8be2 \u2192 ETag \u5bf9\u6bd4 \u2192 \u51b2\u7a81\u68c0\u6d4b \u2192 \u672c\u5730\u5360\u4f4d\u7b26\u521b\u5efa\/\u66f4\u65b0\/\u5220\u9664<\/li>\n<li><strong>\u8131\u6c34<\/strong>\uff08\u7ea2\u8272\uff09\uff1a\u7528\u6237\u53f3\u952e&#8221;\u91ca\u653e\u7a7a\u95f4&#8221; \u2192 Windows \u8bbe\u7f6e UNPINNED \u5c5e\u6027 \u2192 FSW \u540e\u53f0\u626b\u63cf\u68c0\u6d4b \u2192 \u8c03\u7528 CfDehydratePlaceholder \u91ca\u653e\u78c1\u76d8\u7a7a\u95f4<\/li>\n<\/ul>\n<h2>\u6838\u5fc3\u673a\u5236\u8be6\u89e3<\/h2>\n<h3>1. \u5360\u4f4d\u7b26\u6587\u4ef6\uff1a\u4e00\u5207\u7684\u57fa\u7840<\/h3>\n<p>cfapi \u7684\u6838\u5fc3\u6982\u5ff5\u662f<strong>\u5360\u4f4d\u7b26\u6587\u4ef6 (Placeholder File)<\/strong>\u3002\u5b83\u662f\u4e00\u4e2a\u771f\u5b9e\u5b58\u5728\u4e8e NTFS \u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u6587\u4ef6\uff0c\u4f46\u5185\u5bb9\u5728\u4e91\u7aef\uff0c\u672c\u5730\u53ea\u6709\u7ea6 1KB \u7684\u5143\u4fe1\u606f\uff08\u6587\u4ef6\u540d\u3001\u5927\u5c0f\u3001\u65f6\u95f4\u6233\u7b49\uff09\u3002\u5728\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u770b\u8d77\u6765\u548c\u666e\u901a\u6587\u4ef6\u4e00\u6837\uff0c\u53ea\u662f\u5de6\u4e0b\u89d2\u591a\u4e86\u4e2a\u4e91\u6735\u56fe\u6807\u3002<\/p>\n<p>\u5360\u4f4d\u7b26\u6587\u4ef6\u6709\u4e09\u79cd\u72b6\u6001\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u72b6\u6001<\/th>\n<th>\u56fe\u6807<\/th>\n<th>\u542b\u4e49<\/th>\n<th>\u78c1\u76d8\u5360\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u5df2\u8131\u6c34<\/strong><\/td>\n<td>\u2601\ufe0f \u84dd\u8272\u4e91\u6735<\/td>\n<td>\u4ec5\u5143\u4fe1\u606f\uff0c\u5185\u5bb9\u5728\u4e91\u7aef<\/td>\n<td>~1KB<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5df2\u6c34\u5408<\/strong><\/td>\n<td>\u2705 \u7eff\u8272\u52fe(\u7a7a\u5fc3)<\/td>\n<td>\u5185\u5bb9\u5df2\u4e0b\u8f7d\u5230\u672c\u5730<\/td>\n<td>\u5b8c\u6574\u5927\u5c0f<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5df2\u56fa\u5b9a<\/strong><\/td>\n<td>\u2705 \u7eff\u8272\u52fe(\u5b9e\u5fc3)<\/td>\n<td>\u7cfb\u7edf\u4e0d\u4f1a\u81ea\u52a8\u56de\u6536<\/td>\n<td>\u5b8c\u6574\u5927\u5c0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u72b6\u6001\u8f6c\u6362\u903b\u8f91\u548c OneDrive \u5b8c\u5168\u4e00\u81f4\uff1a<\/p>\n<pre><code>\u2601\ufe0f \u5df2\u8131\u6c34 \u2500\u2500\u53cc\u51fb\u6253\u5f00\u2500\u2500\u2192 \u2705 \u5df2\u6c34\u5408 \u2500\u2500\"\u59cb\u7ec8\u4fdd\u7559\"\u2500\u2500\u2192 \u2705 \u5df2\u56fa\u5b9a\n  \u2191                      \u2502                        \u2502\n  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\"\u91ca\u653e\u7a7a\u95f4\"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><\/pre>\n<h3>2. \u76ee\u5f55\u6d4f\u89c8\uff1aFETCH_PLACEHOLDERS \u56de\u8c03<\/h3>\n<p>\u5f53\u7528\u6237\u5728\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u5c55\u5f00\u540c\u6b65\u6839\u4e0b\u7684\u67d0\u4e2a\u6587\u4ef6\u5939\u65f6\uff0cWindows \u5185\u6838\u9a71\u52a8 <code>cldflt.sys<\/code> \u4f1a\u62e6\u622a\u76ee\u5f55\u679a\u4e3e\u8bf7\u6c42\uff0c\u5e76\u5411\u6211\u4eec\u7684\u7a0b\u5e8f\u53d1\u9001 <code>FETCH_PLACEHOLDERS<\/code> \u56de\u8c03\u3002<\/p>\n<pre><code class=\"language-csharp\">\/\/ \u56de\u8c03\u6838\u5fc3\u6d41\u7a0b\nvoid OnFetchPlaceholders(callbackInfo, callbackParameters)\n{\n    \/\/ 1. \u8f6c\u6362\u672c\u5730\u8def\u5f84\u4e3a SMH \u4e91\u7aef\u8def\u5f84\n    var smhPath = ConvertToSmhPath(localPath);\n\n    \/\/ 2. \u8c03\u7528 SMH API \u83b7\u53d6\u76ee\u5f55\u5185\u5bb9\n    var items = await smhClient.ListAllDirectoryItemsAsync(smhPath);\n\n    \/\/ 3. \u7528 CfCreatePlaceholders \u6279\u91cf\u521b\u5efa\u5360\u4f4d\u7b26\n    placeholderManager.CreatePlaceholders(localPath, items);\n}<\/code><\/pre>\n<p><strong>\u5173\u952e\u8e29\u5751<\/strong>\uff1a\u4e0d\u8981\u7528 <code>CfExecute(TransferPlaceholders)<\/code> \u7684\u6570\u7ec4\u53c2\u6570\u6765\u521b\u5efa\u5360\u4f4d\u7b26\u2014\u2014\u4f1a\u521b\u5efa\u51fa&#8221;\u53ef\u89c1\u4f46\u4e0d\u53ef\u8bbf\u95ee&#8221;\u7684\u574f\u5360\u4f4d\u7b26\u3002\u5fc5\u987b\u7528 <code>CfCreatePlaceholders<\/code> \u72ec\u7acb\u521b\u5efa\uff0c\u518d\u7528 <code>CfExecute<\/code> \u901a\u77e5\u5b8c\u6210\u3002<\/p>\n<p><strong>\u9632\u91cd\u5165\u673a\u5236<\/strong>\uff1aWindows \u53ef\u80fd\u5bf9\u540c\u4e00\u76ee\u5f55\u591a\u6b21\u89e6\u53d1\u56de\u8c03\u3002\u7528 <code>ConcurrentDictionary<\/code> \u7f13\u5b58\u5df2\u586b\u5145\u7684\u76ee\u5f55\u8def\u5f84\uff0c\u907f\u514d\u65e0\u9650\u5faa\u73af\u3002<\/p>\n<h3>3. \u6587\u4ef6\u4e0b\u8f7d\uff1a\u4e09\u9636\u6bb5\u6c34\u5408\u5f15\u64ce<\/h3>\n<p>\u8fd9\u662f\u6574\u4e2a\u9879\u76ee\u6700\u6838\u5fc3\u7684\u90e8\u5206\u3002\u5f53\u7528\u6237\u53cc\u51fb\u4e00\u4e2a&#8221;\u5df2\u8131\u6c34&#8221;\u7684\u6587\u4ef6\u65f6\uff0c<code>cldflt.sys<\/code> \u68c0\u6d4b\u5230\u6587\u4ef6\u5185\u5bb9\u4e0d\u53ef\u7528\uff0c\u53d1\u9001 <code>FETCH_DATA<\/code> \u56de\u8c03\u3002<\/p>\n<p>\u6211\u8bbe\u8ba1\u4e86\u4e00\u4e2a<strong>\u4e09\u9636\u6bb5\u6c34\u5408\u5f15\u64ce<\/strong>\uff0c\u652f\u6301\u8fdb\u5ea6\u62a5\u544a\u3001\u65ad\u70b9\u7eed\u4f20\u548c\u5e76\u53d1\u63a7\u5236\uff1a<\/p>\n<pre><code>\u9636\u6bb51: \u4e0b\u8f7d\u6570\u636e\n\u251c\u2500\u2500 \u5c0f\u6587\u4ef6(&lt;50MB): \u4e0b\u8f7d\u5230 MemoryStream\n\u2514\u2500\u2500 \u5927\u6587\u4ef6(\u226550MB): \u4e0b\u8f7d\u5230\u4e34\u65f6 FileStream\n    \u2514\u2500\u2500 \u652f\u6301 HTTP Range \u65ad\u70b9\u7eed\u4f20\n\n\u9636\u6bb52: \u4f20\u8f93\u7ed9 cfapi\n\u251c\u2500\u2500 4MB \u5206\u5757\uff08\u5fc5\u987b 4096 \u9875\u5bf9\u9f50\uff01\uff09\n\u2514\u2500\u2500 \u6bcf 4MB \u6216 500ms \u62a5\u544a\u8fdb\u5ea6\uff08Explorer \u663e\u793a\u8fdb\u5ea6\u6761\uff09\n\n\u9636\u6bb53: \u5b8c\u6210\u5904\u7406\n\u251c\u2500\u2500 CfSetInSyncState(IN_SYNC)\n\u251c\u2500\u2500 SHChangeNotify \u5237\u65b0\u56fe\u6807\n\u2514\u2500\u2500 \u66f4\u65b0 SQLite \u540c\u6b65\u72b6\u6001<\/code><\/pre>\n<p><strong>\u9875\u5bf9\u9f50\u8fd9\u4e2a\u5751\u503c\u5f97\u5355\u72ec\u8bf4<\/strong>\u3002<code>CfExecute(TransferData)<\/code> \u8981\u6c42 Offset \u548c Length \u5fc5\u987b\u662f 4096\uff08PAGE_SIZE\uff09\u7684\u500d\u6570\uff0c\u6700\u540e\u4e00\u5757\u9664\u5916\u3002\u4f46 <code>stream.ReadAsync()<\/code> \u8fd4\u56de\u7684\u5757\u5927\u5c0f\u4e0d\u4fdd\u8bc1\u5bf9\u9f50\u3002\u89e3\u51b3\u65b9\u6848\u662f\u7528 4MB \u7d2f\u79ef\u7f13\u51b2\u533a\uff0c\u6512\u6ee1\u4e00\u6574\u5757\u518d\u4f20\u8f93\uff1a<\/p>\n<pre><code class=\"language-csharp\">byte[] chunkBuffer = new byte[4 * 1024 * 1024]; \/\/ 4MB\uff0c\u672c\u8eab\u5df2 4096 \u5bf9\u9f50\nint chunkFilled = 0;\n\nwhile ((bytesRead = await stream.ReadAsync(...)) &gt; 0)\n{\n    chunkFilled += bytesRead;\n    if (chunkFilled &gt;= ChunkSize)\n    {\n        \/\/ \u6ee1\u5757\u4f20\u8f93\uff08\u5df2\u9875\u5bf9\u9f50\uff09\n        TransferData(connectionKey, transferKey, chunkBuffer, ChunkSize, transferred);\n        transferred += ChunkSize;\n    }\n}\n\/\/ \u6d41\u7ed3\u675f\u65f6\u5237\u65b0\u4f59\u91cf\uff08\u6700\u540e\u4e00\u5757\u4e0d\u8981\u6c42\u9875\u5bf9\u9f50\uff09\nif (chunkFilled &gt; 0)\n    TransferData(..., chunkFilled, transferred);<\/code><\/pre>\n<h3>4. \u6587\u4ef6\u4e0a\u4f20\uff1a\u5148\u8f6c\u540e\u4f20 + \u79d2\u4f20<\/h3>\n<p>\u7528\u6237\u62d6\u62fd\u6587\u4ef6\u5230\u540c\u6b65\u6587\u4ef6\u5939\u65f6\uff0c<code>FileSystemWatcher<\/code> \u68c0\u6d4b\u5230 Created \u4e8b\u4ef6\uff0c\u89e6\u53d1\u4e0a\u4f20\u6d41\u7a0b\u3002<\/p>\n<p>\u4e0a\u4f20\u6d41\u7a0b\u91c7\u7528<strong>\u4e09\u6b65\u8d70<\/strong>\u7b56\u7565\uff1a<\/p>\n<pre><code>\u6b65\u9aa4 1: \u8ba1\u7b97\u54c8\u5e0c\uff08\u5728\u6587\u4ef6\u8fd8\u662f\u666e\u901a\u6587\u4ef6\u65f6\uff0c\u907f\u514d\u8f6c\u5360\u4f4d\u7b26\u540e\u6570\u636e\u53d8\u5316\uff09\n         SMH \u81ea\u5b9a\u4e49\u8fed\u4ee3\u5f0f SHA256\uff08\u4e0d\u662f\u6807\u51c6 SHA256\uff09\n\n\u6b65\u9aa4 2: \u8f6c\u6362\u4e3a\u540c\u6b65\u5360\u4f4d\u7b26\uff08\u5148\u8f6c\u540e\u4f20\uff0c\u6d88\u9664\"\u65e0\u8eab\u4efd\u7a97\u53e3\"\uff09\n\n\u6b65\u9aa4 3: \u667a\u80fd\u4e0a\u4f20\n         \u2192 \u79d2\u4f20\u63a2\u6d4b\uff08\u5f3a\u5236 HTTP\/1.1\uff09\n         \u2192 \u547d\u4e2d(200) \u2192 \u76f4\u63a5\u5b8c\u6210\n         \u2192 \u672a\u547d\u4e2d \u2192 \u6309\u6587\u4ef6\u5927\u5c0f\u9009\u62e9\u4e0a\u4f20\u65b9\u5f0f\n            \u2192 \u2264100MB: \u7b80\u5355\u4e0a\u4f20\n            \u2192 &gt;100MB: \u5206\u7247\u4e0a\u4f20<\/code><\/pre>\n<p><strong>\u79d2\u4f20\u7684 HTTP\/1.1 \u9677\u9631<\/strong>\uff1a.NET 8 \u7684 <code>HttpClient<\/code> \u9ed8\u8ba4\u534f\u5546 HTTP\/2\uff0c\u4f46 SMH \u670d\u52a1\u7aef\u5728 HTTP\/2 \u4e0b\u65e0\u6cd5\u6b63\u786e\u89e3\u6790\u79d2\u4f20 POST body \u4e2d\u7684 hash \u53c2\u6570\uff0c\u5bfc\u81f4\u79d2\u4f20\u6c38\u8fdc\u4e0d\u547d\u4e2d\u3002\u8bca\u65ad\u8fc7\u7a0b\u5f88\u66f2\u6298\u2014\u2014curl \u548c Python \u90fd\u8fd4\u56de 200\uff0c\u552f\u72ec .NET \u8fd4\u56de 201\u3002\u6700\u7ec8\u901a\u8fc7 <code>request.Version = HttpVersion.Version11<\/code> \u89e3\u51b3\u3002<\/p>\n<p><strong>\u53e6\u4e00\u4e2a\u5751<\/strong>\uff1a\u6269\u5c55\u540d\u5927\u5c0f\u5199\u3002SMH \u79d2\u4f20\u7d22\u5f15\u6309\u5c0f\u5199\u6269\u5c55\u540d\u5339\u914d\uff0c<code>.MP4<\/code> \u65e0\u6cd5\u547d\u4e2d\u4f46 <code>.mp4<\/code> \u53ef\u4ee5\u3002\u89e3\u51b3\u65b9\u6848\u662f\u63a2\u6d4b\u65f6\u5f3a\u5236\u5c0f\u5199\u6269\u5c55\u540d\uff0c\u547d\u4e2d\u540e rename \u56de\u539f\u59cb\u6587\u4ef6\u540d\u3002<\/p>\n<h3>5. \u91ca\u653e\u7a7a\u95f4\uff08\u8131\u6c34\uff09\uff1a\u4e3b\u52a8\u68c0\u6d4b\u800c\u975e\u88ab\u52a8\u56de\u8c03<\/h3>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u975e\u5e38\u53cd\u76f4\u89c9\u7684\u8bbe\u8ba1\uff1aWindows \u7684&#8221;\u91ca\u653e\u7a7a\u95f4&#8221;\u64cd\u4f5c<strong>\u4e0d\u4f1a\u89e6\u53d1 cfapi \u7684\u8131\u6c34\u56de\u8c03<\/strong>\uff01<\/p>\n<p>\u5b83\u53ea\u662f\u8bbe\u7f6e\u4e86\u4e00\u4e2a <code>FILE_ATTRIBUTE_UNPINNED<\/code> \u5c5e\u6027\u6807\u8bb0\uff0c\u7136\u540e\u5c31\u6ca1\u6709\u7136\u540e\u4e86\u3002\u63d0\u4f9b\u7a0b\u5e8f\u5fc5\u987b\u81ea\u5df1\u4e3b\u52a8\u8c03\u7528 <code>CfDehydratePlaceholder<\/code> \u6765\u6267\u884c\u5b9e\u9645\u8131\u6c34\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u7528 <code>FileSystemWatcher<\/code> \u76d1\u63a7\u6587\u4ef6\u5c5e\u6027\u53d8\u5316\uff0c\u68c0\u6d4b\u5230 Unpinned \u6807\u5fd7\u540e\u4e3b\u52a8\u6267\u884c\u8131\u6c34\uff1a<\/p>\n<pre><code>\u7528\u6237\u53f3\u952e\"\u91ca\u653e\u7a7a\u95f4\"\n  \u2192 Windows \u8bbe\u7f6e Unpinned \u5c5e\u6027\n  \u2192 FSW \u68c0\u6d4b\u5230 Attributes \u53d8\u5316\n  \u2192 \u68c0\u67e5\uff1a\u662f\u5360\u4f4d\u7b26 + \u5df2\u6c34\u5408 + Unpinned\n  \u2192 \u4e3b\u52a8\u8c03\u7528 CfDehydratePlaceholder()\n  \u2192 \u6587\u4ef6\u53d8\u56de \u2601\ufe0f \u4e91\u6735\u72b6\u6001\uff0c\u91ca\u653e\u672c\u5730\u78c1\u76d8\u7a7a\u95f4<\/code><\/pre>\n<p>\u8131\u6c34\u7684\u524d\u63d0\u6761\u4ef6\u662f\u6587\u4ef6\u5fc5\u987b\u5904\u4e8e <strong>IN_SYNC<\/strong> \u72b6\u6001\u3002\u5982\u679c\u6c34\u5408\u540e\u5fd8\u8bb0\u8c03\u7528 <code>CfSetInSyncState<\/code>\uff0c\u8131\u6c34\u4f1a\u8fd4\u56de <code>0x80070187<\/code> \u9519\u8bef\u3002<\/p>\n<h3>6. \u53cc\u5411\u589e\u91cf\u540c\u6b65<\/h3>\n<p>\u5355\u5411\u4e0a\u4f20\u89e3\u51b3\u4e86\uff0c\u4f46\u5982\u679c\u5728\u53e6\u4e00\u53f0\u8bbe\u5907\u4e0a\u4fee\u6539\u4e86\u4e91\u7aef\u6587\u4ef6\u5462\uff1f\u9700\u8981\u4e00\u4e2a<strong>\u8fdc\u7a0b\u540c\u6b65\u670d\u52a1<\/strong>\u6765\u68c0\u6d4b\u4e91\u7aef\u53d8\u66f4\uff1a<\/p>\n<pre><code>RemoteSyncService \u6bcf 30 \u79d2\u8f6e\u8be2\n  \u2192 \u9012\u5f52\u904d\u5386\u4e91\u7aef\u76ee\u5f55\u6811\n  \u2192 \u5bf9\u6bd4\u672c\u5730 sync_state \u4e2d\u7684 ETag\n  \u2192 \u68c0\u6d4b\u53d8\u66f4\u7c7b\u578b\uff1a\n     \u251c\u2500\u2500 REMOTE_NEW: \u4e91\u7aef\u65b0\u589e \u2192 \u672c\u5730\u521b\u5efa\u5360\u4f4d\u7b26\n     \u251c\u2500\u2500 REMOTE_MODIFIED: \u4e91\u7aef\u4fee\u6539 \u2192 \u672c\u5730\u66f4\u65b0\u5360\u4f4d\u7b26\n     \u2514\u2500\u2500 REMOTE_DELETED: \u4e91\u7aef\u5220\u9664 \u2192 \u4fdd\u7559\u5df2\u6c34\u5408\u6587\u4ef6\uff0c\u4ec5\u5220\u8131\u6c34\u5360\u4f4d\u7b26<\/code><\/pre>\n<p><strong>\u667a\u80fd\u95f4\u9694<\/strong>\uff1a\u57fa\u7840 30 \u79d2 \u2192 \u65e0\u53d8\u66f4\u65f6\u9010\u6b65\u5ef6\u957f\u5230 120 \u79d2 \u2192 \u68c0\u6d4b\u5230\u53d8\u66f4\u5207\u6362\u5feb\u901f\u6a21\u5f0f 15 \u79d2 \u00d7 3 \u8f6e\u3002<\/p>\n<h2>\u90a3\u4e9b\u8ba9\u4eba\u5934\u79c3\u7684\u5751<\/h2>\n<h3>\u5751 1\uff1a\u6587\u4ef6\u62f7\u8d1d\u5230\u7f51\u76d8\u62a5 0x8007017C<\/h3>\n<p>\u7528\u6237\u62f7\u8d1d\u6587\u4ef6\u5230\u540c\u6b65\u6587\u4ef6\u5939\u65f6\uff0cWindows \u7b49\u5f85\u5360\u4f4d\u7b26\u8f6c\u6362\u5b8c\u6210\uff0c\u4f46\u8f6c\u6362\u9700\u8981\u91cd\u8bd5\uff08\u6587\u4ef6\u53ef\u80fd\u88ab Indexer \u9501\u5b9a\uff09\uff0c\u8d85\u65f6\u540e\u8fd4\u56de\u9519\u8bef\u3002<\/p>\n<p>\u89e3\u51b3\uff1a\u5c06\u5360\u4f4d\u7b26\u8f6c\u6362\u6539\u4e3a<strong>\u540e\u53f0\u5f02\u6b65\u6267\u884c<\/strong>\uff0c\u4e0d\u963b\u585e Windows \u7684\u590d\u5236\u64cd\u4f5c\u3002<\/p>\n<h3>\u5751 2\uff1aPPT \u4fdd\u5b58\u540e\u6587\u4ef6\u53d8\u6210\u666e\u901a\u6587\u4ef6<\/h3>\n<p>PowerPoint \u7684&#8221;\u5b89\u5168\u4fdd\u5b58&#8221;\u6a21\u5f0f\uff1a\u5148\u5199\u4e34\u65f6\u6587\u4ef6 <code>pptXXXX.tmp<\/code> \u2192 \u5220\u9664\u539f\u6587\u4ef6 \u2192 \u91cd\u547d\u540d tmp \u4e3a\u539f\u6587\u4ef6\u540d\u3002FSW \u53ea\u770b\u5230\u4e00\u4e2a <code>Renamed<\/code> \u4e8b\u4ef6\uff0c\u65e7\u8def\u5f84\u6ca1\u6709 sync_state\uff0c\u88ab\u8df3\u8fc7\u5904\u7406\u3002<\/p>\n<p>\u89e3\u51b3\uff1a\u901a\u8fc7\u6a21\u5f0f\u5339\u914d\u8bc6\u522b\uff08\u65e7\u8def\u5f84\u662f .tmp + \u65b0\u8def\u5f84\u6709 sync_state\uff09\uff0c\u89c6\u4e3a\u5185\u5bb9\u66f4\u65b0\u89e6\u53d1\u4e0a\u4f20\u3002<\/p>\n<h3>\u5751 3\uff1a\u56de\u6536\u7ad9\u6062\u590d\u540e\u6587\u4ef6\u8fc7\u4e00\u4f1a\u81ea\u52a8\u6d88\u5931<\/h3>\n<p>\u8fd9\u662f\u4e24\u4e2a\u72ec\u7acb Bug \u53e0\u52a0\uff1a<\/p>\n<ol>\n<li>RemoteSync \u7684 SuppressEvents \u7f13\u51b2\u56de\u653e\u6a21\u5f0f\u4f1a\u56de\u653e&#8221;RemoteSync \u81ea\u5df1\u5220\u9664\u5360\u4f4d\u7b26&#8221;\u4ea7\u751f\u7684 Deleted \u4e8b\u4ef6\uff0c\u5bfc\u81f4\u5220\u4e86\u4e91\u7aef\u6587\u4ef6<\/li>\n<li>HandleRemoteDeletedAsync \u65e0\u6761\u4ef6\u5220\u9664\u672c\u5730\u5df2\u6c34\u5408\u6587\u4ef6<\/li>\n<\/ol>\n<p>\u89e3\u51b3\uff1aSuppressEvents \u6539\u4e3a Drop \u6a21\u5f0f\uff08\u4e0d\u7f13\u51b2\u4e0d\u56de\u653e\uff09\uff0cHandleRemoteDeletedAsync \u4fdd\u62a4\u5df2\u6c34\u5408\u6587\u4ef6\u3002<\/p>\n<h3>\u5751 4\uff1a\u4e0b\u8f7d\u5927\u6587\u4ef6\u8d85\u65f6 0x800701AA<\/h3>\n<p>cfapi \u7684 FETCH_DATA \u56de\u8c03\u6709 <strong>60 \u79d2\u8d85\u65f6<\/strong>\u3002\u5927\u6587\u4ef6\u4e00\u6b21\u6027\u4e0b\u8f7d\u6574\u4e2a\u6d41\u671f\u95f4\u4e0d\u8c03\u7528\u4efb\u4f55 cfapi \u51fd\u6570\uff0c\u8d85\u65f6\u540e\u62a5\u9519\u3002<\/p>\n<p>\u89e3\u51b3\uff1a\u5728\u4e0b\u8f7d\u5faa\u73af\u4e2d\u6bcf 15 \u79d2\u8c03\u7528\u4e00\u6b21 <code>CfReportProviderProgress<\/code>\uff0c\u8fd9\u4e2a\u8c03\u7528\u4f1a<strong>\u91cd\u7f6e\u8d85\u65f6\u8ba1\u65f6\u5668<\/strong>\u3002<\/p>\n<h2>\u5f00\u53d1\u8fdb\u5ea6<\/h2>\n<p>\u6574\u4e2a\u9879\u76ee\u7ecf\u5386\u4e86 24 \u4e2a Phase \u7684\u8fed\u4ee3\uff0c\u4ece\u6700\u5c0f\u53ef\u7528\uff08MVP\uff09\u5230\u5b8c\u6574\u7684\u7f51\u76d8\u5ba2\u6237\u7aef\uff1a<\/p>\n<ul>\n<li><strong>Phase 1-2<\/strong>\uff1a\u6700\u5c0f\u53ef\u7528 \u2014 \u6d4f\u89c8\u4e91\u7aef\u6587\u4ef6 + \u4e0b\u8f7d\u6253\u5f00<\/li>\n<li><strong>Phase 3-4<\/strong>\uff1a\u5199\u64cd\u4f5c \u2014 \u4e0a\u4f20\u3001\u521b\u5efa\u3001\u5220\u9664\u3001\u91cd\u547d\u540d<\/li>\n<li><strong>Phase 5-7<\/strong>\uff1a\u4ea7\u54c1\u5316 \u2014 \u7cfb\u7edf\u6258\u76d8\u3001\u5f00\u673a\u81ea\u542f\u3001\u770b\u95e8\u72d7\u4fdd\u6d3b<\/li>\n<li><strong>Phase 8<\/strong>\uff1a\u8131\u6c34\u529f\u80fd \u2014 \u91ca\u653e\u7a7a\u95f4 + FileIdentity \u4fee\u590d<\/li>\n<li><strong>Phase 10<\/strong>\uff1a\u6c34\u5408\u5f15\u64ce\u91cd\u6784 \u2014 \u8fdb\u5ea6\u62a5\u544a\u3001\u65ad\u70b9\u7eed\u4f20\u3001\u5e76\u53d1\u63a7\u5236<\/li>\n<li><strong>Phase 11-16<\/strong>\uff1a\u4f01\u4e1a\u7ea7\u7279\u6027 \u2014 \u51b2\u7a81\u68c0\u6d4b\u3001\u9009\u62e9\u6027\u540c\u6b65\u3001\u53cc\u5411\u540c\u6b65<\/li>\n<li><strong>Phase 17-18<\/strong>\uff1a\u79d2\u4f20\u4fee\u590d \u2014 HTTP\/1.1 \u5f3a\u5236 + \u6269\u5c55\u540d\u5f52\u4e00\u5316<\/li>\n<li><strong>Phase 19-22<\/strong>\uff1a\u7a33\u5b9a\u6027\u52a0\u56fa \u2014 \u526a\u5207\u64cd\u4f5c\u3001\u56de\u6536\u7ad9\u6062\u590d\u3001\u4e8b\u4ef6\u9632\u4e22\u5931<\/li>\n<\/ul>\n<p>\u7d2f\u8ba1\u7f16\u5199\u4e86\u8d85\u8fc7 <strong>660 \u4e2a\u81ea\u52a8\u5316\u6d4b\u8bd5\u7528\u4f8b<\/strong>\uff0c\u8986\u76d6\u4e86\u6c34\u5408\u5f15\u64ce\u3001\u79d2\u4f20\u68c0\u6d4b\u3001\u51b2\u7a81\u89e3\u51b3\u3001\u9009\u62e9\u6027\u540c\u6b65\u7b49\u6838\u5fc3\u6a21\u5757\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u505a\u4e00\u4e2a&#8221;\u7c7b OneDrive&#8221;\u7684\u7f51\u76d8\u5ba2\u6237\u7aef\uff0c\u6838\u5fc3\u5c31\u662f\u7528\u597d Cloud Files API\u3002\u8fd9\u4e2a API \u63d0\u4f9b\u4e86\u7cfb\u7edf\u7ea7\u7684\u96c6\u6210\u80fd\u529b\uff0c\u4f46\u6587\u6863\u548c\u793a\u4f8b\u90fd\u6bd4\u8f83\u5c11\uff0c\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u8e29\u4e86\u4e0d\u5c11\u5751\u3002<\/p>\n<p><strong>\u6700\u5173\u952e\u7684\u51e0\u70b9\u7ecf\u9a8c<\/strong>\uff1a<\/p>\n<ol>\n<li><strong>\u5360\u4f4d\u7b26\u6587\u4ef6\u7684\u9875\u5bf9\u9f50\u4f20\u8f93<\/strong> \u2014 \u8fdd\u53cd 4096 \u5bf9\u9f50\u8981\u6c42\u4f1a\u5f97\u5230\u83ab\u540d\u5176\u5999\u7684\u9519\u8bef\u7801<\/li>\n<li><strong>IN_SYNC \u72b6\u6001\u7ba1\u7406<\/strong> \u2014 \u6c34\u5408\u540e\u5fc5\u987b\u6807\u8bb0 IN_SYNC\uff0c\u8131\u6c34\u524d\u5fc5\u987b IN_SYNC<\/li>\n<li><strong>FileIdentity \u4e0d\u53ef\u9057\u6f0f<\/strong> \u2014 CfConvertToPlaceholder \u5fc5\u987b\u4f20\u5165\uff0c\u5426\u5219\u8131\u6c34\u76f4\u63a5\u62a5\u9519<\/li>\n<li><strong>&#8220;\u91ca\u653e\u7a7a\u95f4&#8221;\u9700\u8981\u4e3b\u52a8\u8131\u6c34<\/strong> \u2014 Windows \u4e0d\u4f1a\u81ea\u52a8\u89e6\u53d1\uff0c\u5fc5\u987b\u81ea\u5df1\u68c0\u6d4b Unpinned \u5c5e\u6027<\/li>\n<li><strong>FSW \u4e8b\u4ef6\u4e0d\u8981\u7f13\u51b2\u56de\u653e<\/strong> \u2014 \u65e0\u6cd5\u533a\u5206\u4e8b\u4ef6\u6765\u6e90\uff0c\u56de\u653e\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931<\/li>\n<li><strong>HTTP \u7248\u672c\u5f88\u5173\u952e<\/strong> \u2014 .NET \u9ed8\u8ba4 HTTP\/2\uff0c\u67d0\u4e9b\u670d\u52a1\u7aef\uff08\u5982 SMH\uff09\u5728 HTTP\/2 \u4e0b\u884c\u4e3a\u4e0d\u540c<\/li>\n<\/ol>\n<p>\u9879\u76ee\u4ee3\u7801\u7ed3\u6784\u548c\u5b8c\u6574\u7684 3000 \u884c\u8bbe\u8ba1\u6587\u6863\u90fd\u7ef4\u62a4\u5728\u4ed3\u5e93\u4e2d\uff0c\u5982\u679c\u4f60\u4e5f\u5728\u505a\u7c7b\u4f3c\u7684 Windows \u4e91\u5b58\u50a8\u5ba2\u6237\u7aef\u96c6\u6210\uff0c\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u4f60\u5c11\u8d70\u5f2f\u8def\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u57fa\u4e8e\u817e\u8baf\u4e91 SMH \u7684 Windows \u7f51\u76d8\u5ba2\u6237\u7aef Demo\uff0c\u4ece\u96f6\u5230\u5b8c\u5168\u53ef\u7528 &hellip; <a href=\"https:\/\/www.gaohui.xyz\/?p=194\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/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":[6,10],"tags":[11],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-cos","category-10","tag-11"],"_links":{"self":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":1,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/196"}],"wp:attachment":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}