{"id":147489,"date":"2024-11-01T12:52:26","date_gmt":"2024-11-01T04:52:26","guid":{"rendered":"https:\/\/server.hk\/cnblog\/147489\/"},"modified":"2024-11-01T12:52:27","modified_gmt":"2024-11-01T04:52:27","slug":"wp7%e9%96%8b%e7%99%bc%e4%b8%ad%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b3%bb%e7%b5%b1%e9%81%b8%e6%93%87","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/147489\/","title":{"rendered":"WP7\u958b\u767c\u4e2d\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u9078\u64c7"},"content":{"rendered":"<h1 id=\"wp7%e9%96%8b%e7%99%bc%e4%b8%ad%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b3%bb%e7%b5%b1%e9%81%b8%e6%93%87-yHhVVhZLSf\">WP7\u958b\u767c\u4e2d\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u9078\u64c7<\/h1>\n<p>\u5728\u9032\u884cWindows Phone 7\uff08WP7\uff09\u61c9\u7528\u7a0b\u5f0f\u958b\u767c\u6642\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u6578\u64da\u5eab\u4e0d\u50c5\u5f71\u97ff\u61c9\u7528\u7a0b\u5f0f\u7684\u6027\u80fd\uff0c\u9084\u6703\u5f71\u97ff\u7528\u6236\u9ad4\u9a57\u548c\u6578\u64da\u7ba1\u7406\u7684\u6548\u7387\u3002\u672c\u6587\u5c07\u63a2\u8a0eWP7\u958b\u767c\u4e2d\u53ef\u7528\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u9078\u64c7\uff0c\u4e26\u5206\u6790\u5b83\u5011\u7684\u512a\u7f3a\u9ede\u3002<\/p>\n<h2 id=\"1-wp7%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab%e9%9c%80%e6%b1%82-yHhVVhZLSf\">1. WP7\u7684\u6578\u64da\u5eab\u9700\u6c42<\/h2>\n<p>WP7\u61c9\u7528\u7a0b\u5f0f\u901a\u5e38\u9700\u8981\u5b58\u5132\u7528\u6236\u6578\u64da\u3001\u61c9\u7528\u8a2d\u7f6e\u548c\u5176\u4ed6\u76f8\u95dc\u4fe1\u606f\u3002\u9019\u4e9b\u6578\u64da\u7684\u5b58\u5132\u65b9\u5f0f\u53ef\u4ee5\u662f\u672c\u5730\u6578\u64da\u5eab\u6216\u96f2\u7aef\u6578\u64da\u5eab\u3002\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u53d6\u6c7a\u65bc\u61c9\u7528\u7684\u9700\u6c42\u3001\u6578\u64da\u7684\u6027\u8cea\u4ee5\u53ca\u7528\u6236\u7684\u4f7f\u7528\u5834\u666f\u3002<\/p>\n<h2 id=\"2-%e6%9c%ac%e5%9c%b0%e6%95%b8%e6%93%9a%e5%ba%ab%e9%81%b8%e6%93%87-yHhVVhZLSf\">2. \u672c\u5730\u6578\u64da\u5eab\u9078\u64c7<\/h2>\n<p>\u5728WP7\u958b\u767c\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u672c\u5730\u6578\u64da\u5eab\u662fSQLite\u3002SQLite\u662f\u4e00\u500b\u8f15\u91cf\u7d1a\u7684\u95dc\u806f\u6578\u64da\u5eab\uff0c\u9069\u5408\u7528\u65bc\u79fb\u52d5\u8a2d\u5099\u3002\u4ee5\u4e0b\u662fSQLite\u7684\u4e00\u4e9b\u512a\u9ede\u548c\u7f3a\u9ede\uff1a<\/p>\n<ul>\n<li><strong>\u512a\u9ede\uff1a<\/strong>\n<ul>\n<li>\u8f15\u91cf\u7d1a\uff1aSQLite\u7684\u9ad4\u7a4d\u5c0f\uff0c\u9069\u5408\u79fb\u52d5\u8a2d\u5099\u4f7f\u7528\u3002<\/li>\n<li>\u6613\u65bc\u4f7f\u7528\uff1aSQLite\u7684API\u7c21\u55ae\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u5feb\u901f\u4e0a\u624b\u3002<\/li>\n<li>\u7121\u9700\u4f3a\u670d\u5668\uff1aSQLite\u662f\u4e00\u500b\u5d4c\u5165\u5f0f\u6578\u64da\u5eab\uff0c\u7121\u9700\u984d\u5916\u7684\u4f3a\u670d\u5668\u652f\u6301\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7f3a\u9ede\uff1a<\/strong>\n<ul>\n<li>\u4e26\u767c\u6027\uff1aSQLite\u5728\u9ad8\u4e26\u767c\u7684\u60c5\u6cc1\u4e0b\u6027\u80fd\u53ef\u80fd\u6703\u4e0b\u964d\u3002<\/li>\n<li>\u529f\u80fd\u9650\u5236\uff1a\u76f8\u8f03\u65bc\u5176\u4ed6\u5927\u578b\u6578\u64da\u5eab\uff0cSQLite\u7684\u529f\u80fd\u8f03\u70ba\u7c21\u55ae\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"sqlite%e7%9a%84%e5%9f%ba%e6%9c%ac%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b-yHhVVhZLSf\">SQLite\u7684\u57fa\u672c\u4f7f\u7528\u793a\u4f8b<\/h3>\n<pre><code>using (var connection = new SQLiteConnection(\"Data Source=mydatabase.db\"))\n{\n    connection.Open();\n    var command = new SQLiteCommand(\"CREATE TABLE IF NOT EXISTS Users (Id INTEGER PRIMARY KEY, Name TEXT)\", connection);\n    command.ExecuteNonQuery();\n}<\/code><\/pre>\n<h2 id=\"3-%e9%9b%b2%e7%ab%af%e6%95%b8%e6%93%9a%e5%ba%ab%e9%81%b8%e6%93%87-yHhVVhZLSf\">3. \u96f2\u7aef\u6578\u64da\u5eab\u9078\u64c7<\/h2>\n<p>\u96a8\u8457\u96f2\u8a08\u7b97\u7684\u666e\u53ca\uff0c\u8a31\u591a\u958b\u767c\u8005\u9078\u64c7\u4f7f\u7528\u96f2\u7aef\u6578\u64da\u5eab\u4f86\u5b58\u5132\u61c9\u7528\u6578\u64da\u3002\u96f2\u7aef\u6578\u64da\u5eab\u7684\u512a\u52e2\u5728\u65bc\u5176\u53ef\u64f4\u5c55\u6027\u548c\u9ad8\u53ef\u7528\u6027\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u96f2\u7aef\u6578\u64da\u5eab\u9078\u64c7\uff1a<\/p>\n<ul>\n<li><strong>Microsoft Azure SQL Database\uff1a<\/strong>\u9019\u662f\u4e00\u500b\u5b8c\u5168\u7ba1\u7406\u7684\u95dc\u806f\u6578\u64da\u5eab\u670d\u52d9\uff0c\u9069\u5408\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u64f4\u5c55\u6027\u7684\u61c9\u7528\u3002<\/li>\n<li><strong>Firebase Realtime Database\uff1a<\/strong>\u9019\u662f\u4e00\u500bNoSQL\u96f2\u7aef\u6578\u64da\u5eab\uff0c\u9069\u5408\u9700\u8981\u5be6\u6642\u6578\u64da\u540c\u6b65\u7684\u61c9\u7528\u3002<\/li>\n<\/ul>\n<h3 id=\"%e9%9b%b2%e7%ab%af%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%84%aa%e7%bc%ba%e9%bb%9e-yHhVVhZLSf\">\u96f2\u7aef\u6578\u64da\u5eab\u7684\u512a\u7f3a\u9ede<\/h3>\n<ul>\n<li><strong>\u512a\u9ede\uff1a<\/strong>\n<ul>\n<li>\u53ef\u64f4\u5c55\u6027\uff1a\u96f2\u7aef\u6578\u64da\u5eab\u53ef\u4ee5\u6839\u64da\u9700\u6c42\u8f15\u9b06\u64f4\u5c55\u3002<\/li>\n<li>\u9ad8\u53ef\u7528\u6027\uff1a\u5927\u591a\u6578\u96f2\u7aef\u6578\u64da\u5eab\u63d0\u4f9b99.9%\u7684\u53ef\u7528\u6027\u4fdd\u8b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7f3a\u9ede\uff1a<\/strong>\n<ul>\n<li>\u5ef6\u9072\uff1a\u7531\u65bc\u6578\u64da\u9700\u8981\u901a\u904e\u7db2\u7d61\u50b3\u8f38\uff0c\u53ef\u80fd\u6703\u51fa\u73fe\u5ef6\u9072\u3002<\/li>\n<li>\u6210\u672c\uff1a\u96f2\u7aef\u6578\u64da\u5eab\u7684\u4f7f\u7528\u6210\u672c\u53ef\u80fd\u6703\u96a8\u8457\u6578\u64da\u91cf\u7684\u589e\u52a0\u800c\u4e0a\u5347\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"4-%e7%b5%90%e8%ab%96-yHhVVhZLSf\">4. \u7d50\u8ad6<\/h2>\n<p>\u5728WP7\u958b\u767c\u4e2d\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u81f3\u95dc\u91cd\u8981\u3002SQLite\u9069\u5408\u9700\u8981\u672c\u5730\u5b58\u5132\u7684\u61c9\u7528\uff0c\u800c\u96f2\u7aef\u6578\u64da\u5eab\u5247\u9069\u5408\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u53ef\u64f4\u5c55\u6027\u7684\u61c9\u7528\u3002\u958b\u767c\u8005\u61c9\u6839\u64da\u61c9\u7528\u7684\u5177\u9ad4\u9700\u6c42\u4f86\u9078\u64c7\u6700\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u652f\u6301\u60a8\u7684\u61c9\u7528\u958b\u767c\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u7684\u5ba2\u6236\u3002\u7121\u8ad6\u662f\u672c\u5730\u6578\u64da\u5eab\u9084\u662f\u96f2\u7aef\u6578\u64da\u5eab\uff0c\u9078\u64c7\u5408\u9069\u7684\u4f3a\u670d\u5668\u914d\u7f6e\u90fd\u80fd\u63d0\u5347\u60a8\u7684\u61c9\u7528\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22WP7\u958b\u767c\u4e2d\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u9078\u64c7\uff0c\u4e86\u89e3\u4e0d\u540c\u9078\u9805\u7684\u512a\u7f3a\u9ede\uff0c\u52a9\u60a8\u505a\u51fa\u6700\u4f73\u6c7a\u7b56\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-147489","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/147489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=147489"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/147489\/revisions"}],"predecessor-version":[{"id":147490,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/147489\/revisions\/147490"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=147489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=147489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=147489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}