form1.vb

来自「用于richtext框中」· VB 代码 · 共 30 行

VB
30
字号
Imports System.IO

Public Class Form1

    Dim change As Change
    Dim mytext As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim oldstring1, oldstring2, oldstring3 As String
        Dim newstring1, newstring2, newstring3 As String
        Try
            Using myStreamReader As StreamReader = File.OpenText("C:\tmp\try1VS\Debug\try1.exp")
                mytext = myStreamReader.ReadToEnd()
            End Using
        Catch ex As Exception
            MessageBox.Show("文件无法打开或读取" + Environment.NewLine + "请确认文件名是否正确" + Environment.NewLine + Environment.NewLine + "异常:" + ex.Message)
        End Try
        oldstring1 = "H="
        newstring1 = "H=" & Me.TextBox1.Text
        change = New Change
        change.mychange("C:\tmp\try1VS\Debug\try1.exp", oldstring1, newstring1)
        MessageBox.Show("请重新读入")
    End Sub

End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?