天天看点

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, "提示")

继续阅读