{"rsdb":{"rid":"397261","subhead":"","postdate":"0","aid":"273496","fid":"85","uid":"1","topic":"1","content":"
\n

\u5728\u4eca\u5929\u7684\u79fb\u52a8\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u624b\u673a\u5df2\u7ecf\u6210\u4e3a\u4e86\u4eba\u4eec\u4e0d\u53ef\u6216\u7f3a\u7684\u91cd\u8981\u5de5\u5177\uff0c\u800c\u624b\u673a\u7684\u8054\u7f51\u72b6\u6001\u4e5f\u662f\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u5173\u6ce8\u7684\u4e00\u4e2a\u95ee\u9898\u3002\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u624b\u673a\u7f51\u7edc\u5904\u4e8e\u6b63\u5e38\u7684\u8fde\u63a5\u72b6\u6001\uff0c\u4f46\u662f\u6709\u65f6\u5019\uff0c\u7531\u4e8e\u79cd\u79cd\u539f\u56e0\uff0c\u624b\u673a\u7684\u7f51\u7edc\u53ef\u80fd\u4f1a\u65ad\u5f00\uff0c\u8fd9\u65f6\u6211\u4eec\u9700\u8981\u53ca\u65f6\u53d1\u73b0\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\u63aa\u65bd\u3002\u800c\u5229\u7528Api\u63a5\u53e3\u5b9e\u73b0\u624b\u673a\u7f51\u7edc\u8fde\u63a5\u65ad\u5f00\u7684\u76d1\u542c\uff0c\u4fbf\u662f\u4e00\u79cd\u8f83\u4e3a\u9ad8\u6548\u7684\u65b9\u6848\u3002<\/p> \n

\"\"<\/p> \n

 <\/p> \n

\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5229\u7528\u6316\u6570\u636e\u5e73\u53f0\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u8fdb\u884c\u624b\u673a\u7f51\u7edc\u8fde\u63a5\u65ad\u5f00\u7684\u76d1\u542c\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u6ce8\u518c\u4e00\u4e2a\u6316\u6570\u636e\u5e73\u53f0\u7684\u8d26\u53f7\uff0c\u5e76\u83b7\u53d6\u5230\u8be5\u5e73\u53f0\u63d0\u4f9b\u7684API Key\u3002API Key\u662f\u6211\u4eec\u8bbf\u95ee\u8fd9\u4e2aAPI\u63a5\u53e3\u7684\u8eab\u4efd\u8ba4\u8bc1\uff0c\u53ea\u6709\u83b7\u53d6\u5230\u8be5Key\uff0c\u624d\u80fd\u8c03\u7528\u8be5\u63a5\u53e3\u3002\u63a5\u7740\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u7684\u6b65\u9aa4\u6765\u5b9e\u73b0\u624b\u673a\u7f51\u7edc\u8fde\u63a5\u65ad\u5f00\u7684\u76d1\u542c\u3002<\/p> \n

\"\"<\/p> \n

 <\/p> \n

\u4e00. \u83b7\u53d6\u624b\u673a\u53f7\u7801<\/strong>
\u6211\u4eec\u9996\u5148\u9700\u8981\u83b7\u53d6\u5230\u5f53\u524d\u624b\u673a\u7684\u624b\u673a\u53f7\u7801\uff0c\u4ee5\u4fbf\u540e\u7eed\u80fd\u591f\u5bf9\u8be5\u53f7\u7801\u8fdb\u884c\u76f8\u5173\u7684\u72b6\u6001\u67e5\u8be2\u3002\u83b7\u53d6\u624b\u673a\u53f7\u7801\u7684\u65b9\u6cd5\u56e0\u624b\u673a\u578b\u53f7\u548c\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u7684\u4e0d\u540c\u800c\u6709\u6240\u4e0d\u540c\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\u3002<\/p> \n

\"\"<\/p> \n

 <\/p> \n

\u4e8c. \u8c03\u7528API\u63a5\u53e3<\/strong>
\u6211\u4eec\u53ef\u4ee5\u5c06\u8be5\u624b\u673a\u53f7\u7801\u4f5c\u4e3a\u53c2\u6570\uff0c\u5411\u6316\u6570\u636e\u5e73\u53f0\u63d0\u4f9b\u7684API\u63a5\u53e3\u53d1\u9001\u8bf7\u6c42\uff0c\u67e5\u8be2\u8be5\u53f7\u7801\u5728\u7f51\u72b6\u6001\u3002\u6839\u636e\u8fd4\u56de\u7ed3\u679c\uff0c\u6211\u4eec\u80fd\u591f\u77e5\u9053\u8be5\u53f7\u7801\u7684\u7f51\u7edc\u8fde\u63a5\u60c5\u51b5\u3002\u63a5\u53e3\u8fd4\u56de\u7684\u72b6\u6001\u4fe1\u606f\u5305\u62ec\u201c\u6b63\u5e38\u4f7f\u7528\u201d\u3001\u201c\u505c\u673a\u201d\u3001\u201c\u672a\u542f\u7528\/\u5728\u7f51\u4f46\u4e0d\u53ef\u7528\u201d\u3001\u201c\u4e0d\u5728\u7f51\uff08\u9500\u53f7\/\u672a\u542f\u7528\/\u5f02\u5e38\uff09\u201d\u548c\u201c\u9884\u9500\u6237\u201d\u7b49\u591a\u79cd\u72b6\u6001\uff0c\u8986\u76d6\u4e86\u6211\u4eec\u53ef\u80fd\u9047\u5230\u7684\u6240\u6709\u60c5\u51b5\u3002<\/p> \n

\u4ee5\u4e0b\u662f\u8c03\u7528API\u63a5\u53e3\u7684\u4ee3\u7801\u793a\u4f8b\uff1a<\/p> \n

\n
python<\/a>\nimport requests\n\nurl <\/span>= "<\/span>http:\/\/api.wapi.cn\/mobile\/check<\/span>"<\/span>\n\npayload <\/span>= {'<\/span>key<\/span>'<\/span>: '<\/span>your_api_key<\/span>'<\/span>,\n<\/span>'<\/span>mobile<\/span>'<\/span>: '<\/span>your_phone_number<\/span>'<\/span>}\n\nresponse <\/span>= requests.get<\/span>(url, params<\/span>=payload)\n\nprint(response.text)<\/span><\/pre> \n <\/div> \n 

 <\/p> \n

\u5176\u4e2d\uff0ckey\u4e3a\u6211\u4eec\u7684API Key\uff0cmobile\u4e3a\u6211\u4eec\u7684\u624b\u673a\u53f7\u7801\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528\u4e86Python\u4e2d\u7684requests\u5e93\u6765\u53d1\u9001API\u8bf7\u6c42\uff0c\u83b7\u53d6\u5230\u4e86\u63a5\u53e3\u8fd4\u56de\u7684\u72b6\u6001\u4fe1\u606f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8e\u8be5API\u63a5\u53e3\u662f\u9700\u8981\u8fdb\u884c\u8eab\u4efd\u8ba4\u8bc1\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u5fc5\u987b\u5c06API Key\u4f5c\u4e3a\u8bf7\u6c42\u53c2\u6570\u53d1\u9001\u7ed9\u63a5\u53e3\u3002<\/p> \n

\u4e09. \u5b9e\u73b0\u76d1\u542c\u529f\u80fd<\/strong>
\u5728\u5f97\u5230\u4e86\u5f53\u524d\u624b\u673a\u7684\u7f51\u7edc\u72b6\u6001\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5b9e\u73b0\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u7684\u76d1\u542c\u529f\u80fd\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Android\u7cfb\u7edf\u4e2d\u63d0\u4f9b\u7684\u5e7f\u64ad\u673a\u5236\uff0c\u6765\u76d1\u542c\u7f51\u7edc\u72b6\u6001\u53d8\u5316\u7684\u4e8b\u4ef6\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6211\u4eec\u9700\u8981\u6ce8\u518c\u4e00\u4e2a\u7f51\u7edc\u53d8\u5316\u5e7f\u64ad\u63a5\u6536\u5668\uff0c\u5e76\u5728\u63a5\u6536\u5230\u7f51\u7edc\u53d8\u5316\u7684\u5e7f\u64ad\u4e8b\u4ef6\u65f6\uff0c\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\u3002<\/p> \n

\u4ee5\u4e0b\u662f\u5b9e\u73b0\u76d1\u542c\u529f\u80fd\u7684\u4ee3\u7801\u793a\u4f8b\uff1a<\/p> \n

\n
import android\n\ndroid <\/span>= android.Android()\n\n<\/span>class<\/span> ConnectivityReceiver:\n    def __init__(self):\n        self.previous_state <\/span>= None\n\n    def onReceive(self, context, intent):\n        <\/span>if<\/span> intent.getAction() == "<\/span>android.net.conn.CONNECTIVITY_CHANGE<\/span>"<\/span>:\n            <\/span>try<\/span>:\n                is_connected <\/span>= droid.checkWifiConnected().result\n            except Exception:\n                is_connected <\/span>= False\n\n            <\/span>if<\/span> is_connected != self<\/pre> \n <\/div> \n 

 <\/p> \n<\/div>","orderid":"0","title":"\u5229\u7528Api\u63a5\u53e3\u5b9e\u73b0\u624b\u673a\u7f51\u7edc\u8fde\u63a5\u65ad\u5f00\u7684\u76d1\u542c","smalltitle":"","mid":"0","fname":"PHP","special_id":"0","bak_id":"0","info":"0","hits":"213","pages":"1","comments":"0","posttime":"2023-09-23 15:43:47","list":"1695455027","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u5229\u7528<\/A> Api<\/A> \u8fde\u63a5\u65ad<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"112.94.1.100","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"\u5229\u7528Api\u63a5\u53e3\u5b9e\u73b0\u624b\u673a\u7f51\u7edc\u8fde\u63a5\u65ad\u5f00\u7684\u76d1\u542c","lastview":"1713309872","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}