VB.NET質問スレ(Part29)
■ このスレッドは過去ログ倉庫に格納されています
0736718
2009/04/14(火) 01:22:08レスありがとうございます。
ソースはこんな感じです。
Module Module1
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal IpApplicationName As String,
ByVal IpKeyName As String, ByVal IpDefault As String, ByVal IpReturnedString As String, ByVal nSize As Integer, ByVal IpFileName As String) As Integer
End Module
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intLength As Integer
Dim intReturnValue As Integer
Dim strReturnValue As String = Space(100)
intLength = GetPrivateProfileString("VALUES", "VALUE1", Nothing, strReturnValue, strReturnValue.Length, strFilePath)
TextBox1.Text = strReturnValue.Substring(0, intLength)
End Sub
※iniファイルの中身
[VALUES]
VALUE1=(あいうえお)
VALUE2=(かきくけこ)
VALUE3=(さしすせそ)
■ このスレッドは過去ログ倉庫に格納されています