dsapi是一种非常强大的扩展方法,学习与使用见群419130936
Public Class Form3
Private 信息 As New 保存信息
Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim 文件路径 As String = $"{当前程序所在文件夹()}\保存.dat"
If 存在文件(文件路径) = 否 Then Exit Sub
信息 = 读取文本文件(文件路径).Json反序列化(Of 保存信息)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
With 信息
.账号 = TextBox1.Text
.密码 = TextBox2.Text
.上次登录时间 = 当前时间()
End With
信息.Json序列化.保存到文件($"{当前程序所在文件夹()}\保存.dat")
End Sub
End Class
<Serializable>
Public Class 保存信息
Public 账号 As String
Public 密码 As String
Public 上次登录时间 As Date
End Class
Public Class 冲击冷却
Public Cn As Single
Public Zn As Single
Public d As Single
Public f1 As Single
Public AH As Single
Public Num As Single
Public Function Z(airwx As Single()) As Single
Return Z
End Function
Public Function Nu(airwx As Single()) As Single
Return Nu
End Function
End Class