{"id":1031,"date":"2024-07-03T09:23:15","date_gmt":"2024-07-03T01:23:15","guid":{"rendered":"http:\/\/www.wyrcad.com\/?p=1031"},"modified":"2024-07-17T10:26:30","modified_gmt":"2024-07-17T02:26:30","slug":"%e5%88%9d%e5%a7%8b%e5%8c%96%e6%96%87%e4%bb%b6%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.wyrcad.com\/?p=1031","title":{"rendered":"\u521d\u59cb\u5316\u6587\u4ef6(Initialization File)\u51fd\u6570\u7cfb\u5217\u4e4b\u4e00"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Option Explicit<br>Public Const BUFFER = 256<br>Public Declare Function GetProfileInt Lib &#8220;kernel32&#8221; Alias &#8220;GetProfileIntA&#8221; (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Long) As Long<br>Public Declare Function GetProfileSection Lib &#8220;kernel32&#8221; Alias &#8220;GetProfileSectionA&#8221; (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long<br>Public Declare Function GetProfileString Lib &#8220;kernel32&#8221; Alias &#8220;GetProfileStringA&#8221; (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long<br>Public Declare Function GetPrivateProfileInt Lib &#8220;kernel32&#8221; Alias &#8220;GetPrivateProfileIntA&#8221; (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long<br>Public Declare Function GetPrivateProfileSection Lib &#8220;kernel32&#8221; Alias &#8220;GetPrivateProfileSectionA&#8221; (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long<br>Public Declare Function GetPrivateProfileString Lib &#8220;kernel32&#8221; Alias &#8220;GetPrivateProfileStringA&#8221; (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long<br>Public Declare Function WriteProfileSection Lib &#8220;kernel32&#8221; Alias &#8220;WriteProfileSectionA&#8221; (ByVal lpAppName As String, ByVal lpString As String) As Long<br>Public Declare Function WriteProfileString Lib &#8220;kernel32&#8221; Alias &#8220;WriteProfileStringA&#8221; (ByVal lpszSection As String, ByVal lpszKeyName As String, ByVal lpszString As String) As Long<br>Public Declare Function WritePrivateProfileSection Lib &#8220;kernel32&#8221; Alias &#8220;WritePrivateProfileSectionA&#8221; (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) As Long<br>Public Declare Function WritePrivateProfileString Lib &#8220;kernel32&#8221; Alias &#8220;WritePrivateProfileStringA&#8221; (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Public Function WriteIniFile(ByVal sApp As String, ByVal sKey As String, ByVal sData As String, ByVal sIniFile As String) As Long<br>WriteIniFile = WritePrivateProfileString(sApp, sKey, sData, sIniFile)<br>End Function<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Public Function ReadIniFile(ByVal sApp As String, ByVal sKey As String, ByVal sIniFile As String) As String<br>Dim sBuffer As String<br>sBuffer = Space$(BUFFER)<br>If GetPrivateProfileString(sApp, sKey, &#8220;&#8221;, sBuffer, BUFFER, sIniFile) > 0 Then<br>ReadIniFile = <a href=\"https:\/\/www.wyrcad.com\/?p=785\">GetAPIString<\/a>(sBuffer)<br>Else<br>ReadIniFile = &#8220;&#8221;<br>End If<br>End Function<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Option ExplicitPublic Const BUFFER = 256Public Declare  &hellip; <a href=\"https:\/\/www.wyrcad.com\/?p=1031\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u521d\u59cb\u5316\u6587\u4ef6(Initialization File)\u51fd\u6570\u7cfb\u5217\u4e4b\u4e00\u201d<\/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":[12],"tags":[24,17],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-bianchengyuandi","tag-vb","tag-biancheng"],"_links":{"self":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1031"}],"version-history":[{"count":5,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":1312,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions\/1312"}],"wp:attachment":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}