简单的计数器来跟踪表单使用情况?

| 我想知道如何从文本文件中读取数字,然后将该数字乘以一并将其写回到原始文本文件中,所以我想做一个计数器来跟踪我的表单有多少次被执行。然后,这些信息将用于确定我的应用程序在公司中的成功使用。
已邀请:
您可以使用此:
Private Sub Increment()
    Dim Path_To_File As String = \"Path to the file\"
    Try
        Dim Counter As Integer = CInt(My.Computer.FileSystem.ReadAllText(Path_To_File))
        My.Computer.FileSystem.WriteAllText(Path_To_File, (Counter + 1).ToString(), False)
    Catch Ex As Exception \' Modifiy to catch specific errors if you want
        MessageBox.Show(\"An error occured: \" & Ex.ToString())
    End Try
End Sub

要回复问题请先登录注册