天天看點

VB.NET 讀取INI,TXT檔案 寫入資料

讀取

Dim fileContents As String

        fileContents = My.Computer.FileSystem.ReadAllText("E:\flashgame\game\logon.ini") '讀取

        Me.TextBox3.Text = fileContents,指定到文本域

寫入

        If TextBox4.Text = "" Then

            MsgBox("請輸入資料", MsgBoxStyle.Information, "提示")

            Exit Sub

        End If

        My.Computer.FileSystem.WriteAllText("E:\flashgame\game\RuleWindow.txt", TextBox4.Text, False, System.Text.Encoding.Unicode) '儲存

        MsgBox("儲存成功!", MsgBoxStyle.Information, "提示")

繼續閱讀