看板 Visual_Basic 關於我們 聯絡資訊
謝謝 chinoyan 我成功了 參考後的完成code Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click sSection = vbNullString sKey = vbNullString sinifilename = Application.StartupPath & "\config.ini" If Not FileExistOrNot(sinifilename) Then Exit Sub Dim tempStr As String Dim numSection As Integer 'Section數量 '直接引用GetPrivateProfileString sKeyValue = Space(65536) lReturnLen = GetPrivateProfileString(sSection, _ sKey, "", sKeyValue, 32768, sinifilename) tempStr = "" tempStr = sKeyValue.Substring(0, lReturnLen) numSection = UBound(tempStr.Split(Chr(0))) '取得Section數量 MsgBox(tempStr.Split(Chr(0))(numSection - 1)) '試印最後一個Section End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.168.66