My.settings不为空

时间:2017-05-10 20:56:48

标签: vb.net

我启动一个新的应用程序,如果表单已加载,我需要检查my.settings.username键是否退出

我知道如何知道是否为空或如何验证密钥是否存在? 例如,我需要更改或添加到此行 例如别的或类似的东西?      在线如果String.IsNullOrEmpty(My.Settings.username)

这是我的代码

Private Sub trial_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim today As System.DateTime
    Dim answer As System.DateTime

    today = System.DateTime.Now


    Dim trialregister = Label2
    Dim username = TextBox1.Text



    Label2.Text = today
    Label6.Text = My.Settings.trialend

    If String.IsNullOrEmpty(My.Settings.username) Then
        MsgBox("Email cannot be blank!", vbExclamation, "Media Mega Voip")
        TextBox1.Focus()


    End If
    If String.IsNullOrEmpty(My.Settings.trialregister) Then
        today = System.DateTime.Now

        My.Settings.trialregister = today
        My.Settings.trialend = today.AddDays(30)
        My.Settings.Save()
    End If
    If String.IsNullOrEmpty(My.Settings.trialend) Then
        My.Settings.trialregister = today
        My.Settings.trialend = today.AddDays(30)
        My.Settings.Save()
    End If



    If My.Settings.trialregister = My.Settings.trialend Then
        Serials.Show()
        Me.Hide()

    End If
End Sub

1 个答案:

答案 0 :(得分:-1)

以下是检查设置名称是否存在的一种方法:

Uncaught TypeError: Failed to execute 'bindBuffer' on 'WebGL2RenderingContext': parameter 2 is not of type 'WebGLBuffer'.