vb.net ---- 学生考试成绩统计生成系统.txt

学生成绩考核 统计系统

vb.net

输入 学生 考号:姓名:班级:成绩:插入到文本存储库中 读取文本中的信息

搜索固定信息 显示

 

Public Class Form1


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim xh, bj, sname As String
        Dim mark As Double
        FileOpen(1, "d:\data.txt", OpenMode.Append)
        xh = TextBox1.Text
        sname = TextBox2.Text
        bj = TextBox3.Text
        mark = TextBox4.Text
        WriteLine(1, xh, sname, bj, mark)
        MsgBox("写入成功")
        FileClose()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Label5.Visible = True
        TextBox5.Visible = True
        Dim data As String
        FileOpen(1, "D:\data.txt", OpenMode.Input)

        While Not EOF(1)
            data = LineInput(1)
            'Chr(13)表示空格 Chr(10)表示换行
            TextBox5.Text = TextBox5.Text & data & Chr(13) & Chr(10)
        End While
        FileClose(1)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TextBox5.Text = ""
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim data As String
        FileOpen(1, "D:\data.txt", OpenMode.Input)
        While Not EOF(1)
            data = LineInput(1)
            'Chr(13)表示空格 Chr(10)表示换行
            If InStr(data, TextBox6.Text) Then
                TextBox5.Text = Replace(data, "", "") & Chr(13) & Chr(10)
            End If
        End While
        FileClose(1)
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim data As String
        FileOpen(1, "D:\data.txt", OpenMode.Output)
        While Not EOF(1)
            data = LineInput(1)
            'Chr(13)表示空格 Chr(10)表示换行
            If InStr(data, TextBox6.Text) Then
                PrintLine(Replace(data, "", "", ))
            End If
        End While
        FileClose(1)
    End Sub
End Class

 

显示效果:

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值