{"id":47707,"date":"2023-09-30T23:19:22","date_gmt":"2023-09-30T15:19:22","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=47707"},"modified":"2023-09-30T23:19:22","modified_gmt":"2023-09-30T15:19:22","slug":"vpdcksfcz","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/47707.html","title":{"rendered":"VB\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728"},"content":{"rendered":"

  \u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u901a\u4fe1\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u4e24\u53f0\u8ba1\u7b97\u673a\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u5916\u90e8\u8bbe\u5907\uff0c\u5982\u6253\u5370\u673a\uff0c\u626b\u63cf\u4eea\uff0c\u4f20\u611f\u5668\u7b49\u3002\u5728\u4f7f\u7528\u4e32\u53e3\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u51fa\u73b0\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528VB\u6765\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\u3002<\/p>\n

\u4e32\u53e3\u4ecb\u7ecd<\/h2>\n

  \u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u8bbe\u5907\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u5c06\u8ba1\u7b97\u673a\u4e0e\u5916\u90e8\u8bbe\u5907\u8fde\u63a5\u8d77\u6765\uff0c\u4f7f\u5f97\u8ba1\u7b97\u673a\u53ef\u4ee5\u63a7\u5236\u5916\u90e8\u8bbe\u5907\u7684\u8fd0\u884c\u548c\u53d1\u9001\u6570\u636e\u3002\u4e32\u53e3\u901a\u5e38\u7528\u4e8e\u8fde\u63a5\u6253\u5370\u673a\uff0c\u626b\u63cf\u4eea\uff0c\u4f20\u611f\u5668\uff0c\u4ee5\u53ca\u5176\u4ed6\u8bbe\u5907\u3002<\/p>\n

  \u4e32\u53e3\u7684\u7c7b\u578b<\/h3>\n

  \u4e32\u53e3\u5206\u4e3a\u4e24\u7c7b\uff1aRS-232\u4e32\u53e3\u548cRS-485\u4e32\u53e3\u3002RS-232\u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u8bbe\u5907\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u652f\u6301\u591a\u79cd\u5916\u90e8\u8bbe\u5907\uff0c\u6bd4\u5982\u6253\u5370\u673a\uff0c\u626b\u63cf\u4eea\uff0c\u4f20\u611f\u5668\u7b49\u3002RS-485\u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u591a\u53f0\u8ba1\u7b97\u673a\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u591a\u53f0\u8ba1\u7b97\u673a\uff0c\u5b9e\u73b0\u8ba1\u7b97\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n

  \u4e32\u53e3\u7684\u4f7f\u7528<\/h3>\n

  \u5728\u4f7f\u7528\u4e32\u53e3\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u51fa\u73b0\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528VB\u6765\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0c\u4ee5\u4e0b\u662fVB\u7a0b\u5e8f\u4ee3\u7801\uff1a<\/p>\n

  VB\u7a0b\u5e8f\u4ee3\u7801<\/strong><\/p>\n

  Dim com As Object<\/p>\n

  On Error Resume Next<\/p>\n

  Set com = CreateObject(“WScript.Shell”)<\/p>\n

  If Err.Number = 0 Then<\/p>\n

  MsgBox “\u4e32\u53e3\u5b58\u5728”<\/p>\n

  Else<\/p>\n

  MsgBox “\u4e32\u53e3\u4e0d\u5b58\u5728”<\/p>\n

  End If<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u901a\u8fc7\u672c\u6587\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u4e32\u53e3\u7684\u7c7b\u578b\u548c\u4f7f\u7528\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528VB\u6765\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\u3002\u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u8bbe\u5907\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u5c06\u8ba1\u7b97\u673a\u4e0e\u5916\u90e8\u8bbe\u5907\u8fde\u63a5\u8d77\u6765\uff0c\u4f7f\u5f97\u8ba1\u7b97\u673a\u53ef\u4ee5\u63a7\u5236\u5916\u90e8\u8bbe\u5907\u7684\u8fd0\u884c\u548c\u53d1\u9001\u6570\u636e\u3002\u5728\u4f7f\u7528\u4e32\u53e3\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u51fa\u73b0\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528VB\u6765\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0cVB\u7a0b\u5e8f\u4ee3\u7801\u5982\u4e0a\u6240\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e32\u53e3\u662f\u4e00\u79cd\u7528\u4e8e\u901a\u4fe1\u7684\u63a5\u53e3\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u4e24\u53f0\u8ba1\u7b97\u673a\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u5916\u90e8\u8bbe\u5907\uff0c\u5982\u6253\u5370\u673a\uff0c\u626b\u63cf\u4eea\uff0c\u4f20\u611f\u5668\u7b49\u3002\u5728\u4f7f\u7528\u4e32\u53e3\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5224\u65ad\u4e32\u53e3\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[69],"class_list":["post-47707","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-cktx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/47707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=47707"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/47707\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=47707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=47707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=47707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}